Stop Flare from inserting spaces inside <pre> tag

This forum is for all Flare issues not related to any of the other categories.
Post Reply
jonathansimonoff
Propeller Head
Posts: 13
Joined: Thu Apr 14, 2016 7:55 pm

Stop Flare from inserting spaces inside <pre> tag

Post by jonathansimonoff »

I've got code samples in <pre> tags. The problem is that when I insert a tag inside the <pre> tag, Flare inserts spaces on the left to prettify the HTML. The problem is that this is inside a <pre> tag, so those spaces are preserved, messing up the code format.

Is there a way to stop this from happening? The only solution I've found is to insert an extra blank line at the top of my code, which is ugly, as well as a bit of a pain.

(If it matters, I need to add a <code> tag inside the <pre> tag to use a syntax highlighter, prism. I initially thought that the spaces were being inserted on the editing side, but just discovered that it is worse: the are inserted when the HTML is generated. That's right, friends, Flare inserts spaces inside of a <pre> tag when building the HTML. A <pre> tag, the one that preserves spaces. )
jonathansimonoff
Propeller Head
Posts: 13
Joined: Thu Apr 14, 2016 7:55 pm

Re: Stop Flare from inserting spaces inside <pre> tag

Post by jonathansimonoff »

Just an update with my workaround, in case someone else suffers from this. It isn't fun, but it works.

In the XML editor, select the code that is inside the <pre> tag, and apply the <code> format.

Switch to the text editor.

Make sure that the <pre> tag is actually <pre xml:space="preserve">. (For unknown reasons, sometimes it isn't, and then you get the indent in the HTML output even if you do the following.)

Insert a carriage return between the opening <pre> tag and the opening <code> tag.

Remove the spaces that the text editor inserts on the new line to indent the <code> tag, so it is flush left.

Go back to the XML editor to find the next instance.
rob hollinger
Propellus Maximus
Posts: 661
Joined: Mon Mar 17, 2008 8:40 am

Re: Stop Flare from inserting spaces inside <pre> tag

Post by rob hollinger »

It is difficult to replicate this without some kind of example.

Could you please log this as a bug using our Report A Bug link? This way we can replicate it and get it to the Development teams.

Here is a link to the bug submission form:
https://www.madcapsoftware.com/feedback/bugs.aspx

Thank you
Rob Hollinger
MadCap Software
Post Reply