Keeping formatting when pasting text to text editor
-
- Propeller Head
- Posts: 27
- Joined: Mon May 14, 2018 6:21 am
Keeping formatting when pasting text to text editor
When I paste text, in this case code, the indenting gets lost. I get round this by editing the topic file in Sublime text.
Is there a setting which forces Flare to keep the original formatting?
Is there a setting which forces Flare to keep the original formatting?
-
- Senior Propellus Maximus
- Posts: 2634
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Keeping formatting when pasting text to text editor
Some people use a <pre> rather than a <p> for pasting code. I don't, so can't add any more detail, but others have found that works for them.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
-
- Sr. Propeller Head
- Posts: 212
- Joined: Wed Apr 04, 2007 11:50 am
Re: Keeping formatting when pasting text to text editor
I do what you do, DTWT. Would love a better solution.
And for the record, I use <pre> tags, and it doesn't make a difference. The TextEditor is one of the low points of the Flare UI. It has several other flaws that wear me to the bone.
And for the record, I use <pre> tags, and it doesn't make a difference. The TextEditor is one of the low points of the Flare UI. It has several other flaws that wear me to the bone.
-
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Keeping formatting when pasting text to text editor
I understand the aggravation, but HTML5 does not know anything about tabs and tabstops. Indentation requires either styles or non-breaking spaces.
Depending on how many indentation levels are needed, adding styles might be the way to go (see https://www.w3schools.com/cssref/pr_tex ... indent.asp)....although applying them to each of the paragraphs is likely to get old really fast.
Would be neat to assign an indentation value for the tab key acting as accelerator. Pressing tab would then autoapply the proper style based on the style (or lack thereof) that is currently assigned. With tab values at 10% pressing Tab key three times would give a 30% indent. Feature request?
Depending on how many indentation levels are needed, adding styles might be the way to go (see https://www.w3schools.com/cssref/pr_tex ... indent.asp)....although applying them to each of the paragraphs is likely to get old really fast.
Would be neat to assign an indentation value for the tab key acting as accelerator. Pressing tab would then autoapply the proper style based on the style (or lack thereof) that is currently assigned. With tab values at 10% pressing Tab key three times would give a 30% indent. Feature request?
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: Keeping formatting when pasting text to text editor
What works for me is this:
1. Create a new paragraph and assign the <pre> style to it. That means it will preserve the formatting as set, including any spaces and line breaks.
2. Copy and paste the code into that <pre> block. Flare will insert the code as a bunch of <p>'s.
3. Immediately look for the little Paste icon that will appear directly beneath and to the right of the last block added.
4. Click that icon to open a little drop-down menu and select Paste Inline Text. Now all the pasted code should be within the <pre> block and the formatting should look right.
5. Highlight the <pre> block.
6. From the Paragraph pane in the toolbar, select Group.
7. Select <div>.
What I also do, is add a class to the div, so that the code is formatted how we want it - dark background and so on.
1. Create a new paragraph and assign the <pre> style to it. That means it will preserve the formatting as set, including any spaces and line breaks.
2. Copy and paste the code into that <pre> block. Flare will insert the code as a bunch of <p>'s.
3. Immediately look for the little Paste icon that will appear directly beneath and to the right of the last block added.
4. Click that icon to open a little drop-down menu and select Paste Inline Text. Now all the pasted code should be within the <pre> block and the formatting should look right.
5. Highlight the <pre> block.
6. From the Paragraph pane in the toolbar, select Group.
7. Select <div>.
What I also do, is add a class to the div, so that the code is formatted how we want it - dark background and so on.
-
- Sr. Propeller Head
- Posts: 212
- Joined: Wed Apr 04, 2007 11:50 am
Re: Keeping formatting when pasting text to text editor
Bless you, marcinse. I never noticed that Paste icon! So much time to be saved going forward.
I actually just style the <pre> tag with class="code", and that seems to work without adding the enclosing div. Any advantage to one over the other? But also good to remember that "Group" function, which I think I was once vaguely aware of and forgot existed. So double thanks!
I actually just style the <pre> tag with class="code", and that seems to work without adding the enclosing div. Any advantage to one over the other? But also good to remember that "Group" function, which I think I was once vaguely aware of and forgot existed. So double thanks!
-
- Propeller Head
- Posts: 27
- Joined: Mon May 14, 2018 6:21 am
Re: Keeping formatting when pasting text to text editor
Hi Marcinse,marcinse wrote:What works for me is this:
1. Create a new paragraph and assign the <pre> style to it. That means it will preserve the formatting as set, including any spaces and line breaks.
2. Copy and paste the code into that <pre> block. Flare will insert the code as a bunch of <p>'s.
3. Immediately look for the little Paste icon that will appear directly beneath and to the right of the last block added.
4. Click that icon to open a little drop-down menu and select Paste Inline Text. Now all the pasted code should be within the <pre> block and the formatting should look right.
5. Highlight the <pre> block.
6. From the Paragraph pane in the toolbar, select Group.
7. Select <div>.
What I also do, is add a class to the div, so that the code is formatted how we want it - dark background and so on.
Thank you for this, I was going to write
I have tried that. But it seems to add a big margin at the left.
However, I just tried pasting from Sublime text, and all the formatting is retained. What is going on here? I don't know...
Re: Keeping formatting when pasting text to text editor
I couldn't agree more. Come on MadCap - sort this out. The editor is the fundamental part of Flare and it's barely usable.The TextEditor is one of the low points of the Flare UI. It has several other flaws that wear me to the bone.
-
- Senior Propellus Maximus
- Posts: 3672
- Joined: Thu Feb 02, 2006 9:57 am
- Location: Pittsford, NY
Re: Keeping formatting when pasting text to text editor
These are peer-to-peer forums. MadCap folk sometimes join us but they don’t generally follow the discussions. I suggest you submit a bug report/feature request (however you view this) to get MadCap’s attention.itauthor wrote:Come on MadCap - sort this out. The editor is the fundamental part of Flare and it's barely usable.
Nita
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Re: Keeping formatting when pasting text to text editor
Thank you - this works great and solves a number of issues that I am encountering.
However, I am running into an issue with superimposed text when employing the new <div>. The new code block - when viewed in HTML - appears under the preceding text.
How do I get Flare to honor distinct lines of text??
Probably a newbie issue - but, this also occurs in other instances. Still trying to figure out the rhyme or reason. I don't want to manually insert lines breaks. That defeats using responsive HTML.
However, I am running into an issue with superimposed text when employing the new <div>. The new code block - when viewed in HTML - appears under the preceding text.
How do I get Flare to honor distinct lines of text??
Probably a newbie issue - but, this also occurs in other instances. Still trying to figure out the rhyme or reason. I don't want to manually insert lines breaks. That defeats using responsive HTML.
Re: Keeping formatting when pasting text to text editor
This is another "feature" of the Flare XML editor. The editor does not display <div>s well at all. To avoid <div>s superimposed or appearing under surrounding tags, I find that I have to insert manual break tags <br /> before and after any <div> in Flare.I am running into an issue with superimposed text when employing the new <div>. The new code block - when viewed in HTML - appears under the preceding text.
Also, the block structure bars to the left of the editor window do not display <div>s properly, nor can you reliably select a <div> in the structure bars.
Moshe Davis
Jerusalem, Israel
Jerusalem, Israel
Re: Keeping formatting when pasting text to text editor
In the XML Editor's toolbar, click the Show tags icon (looks like an eye), and de-select Object Positioning. That stops Flare trying to display elements in position, and stops these sort of problems.moshe wrote:This is another "feature" of the Flare XML editor. The editor does not display <div>s well at all. To avoid <div>s superimposed or appearing under surrounding tags, I find that I have to insert manual break tags <br /> before and after any <div> in Flare.I am running into an issue with superimposed text when employing the new <div>. The new code block - when viewed in HTML - appears under the preceding text.
Also, the block structure bars to the left of the editor window do not display <div>s properly, nor can you reliably select a <div> in the structure bars.