Flare interprets tag in preformatted code text

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Mark Propellerhead
Propeller Head
Posts: 15
Joined: Fri Feb 21, 2014 10:06 am

Flare interprets tag in preformatted code text

Post by Mark Propellerhead »

Flare interprets the following <SendEvent> tag in preformatted code text, which breaks the XML. Is this a bug or am I missing something? (See inage)

<td class="TableStyle-Alternate-Row-Color-BodyD-Column1-Body1"><div class="codeSnippet code-toolbar"><div class="codeSnippetBody" data-mc-continue="False" data-mc-line-number-start="1" data-mc-use-line-numbers="False" xmlns="http://www.w3.org/1999/xhtml"><pre xmlns="http://www.w3.org/1999/xhtml"><code>Feb 16 10:20:01 ***blrpgpbcp pgp/client[19746]: CLIENT-14812832: client request [internal user R3200]: <SendEvent> </code></pre></div></div></td>
You do not have the required permissions to view the files attached to this post.
trent the thief
Propellus Maximus
Posts: 613
Joined: Wed Feb 01, 2006 6:21 am
Location: Off in the dark....

Re: Flare interprets tag in preformatted code text

Post by trent the thief »

Hi Mark,

Try removing the namespace definitions from the td and div tags.

I would probably also have gone with a Code Snippet and line numbers to display a log file rather than using a table and divs. It seems like a lot of overhead.
Trent.

Certifiable.

Image

umm...
I meant MAD Certified.

Official Propeller Beanie Owner :-)

:flare: Are you on Flare's Slack channels? PM me for an invitation! :flare:
trent the thief
Propellus Maximus
Posts: 613
Joined: Wed Feb 01, 2006 6:21 am
Location: Off in the dark....

Re: Flare interprets tag in preformatted code text

Post by trent the thief »

Hi Mark,

Try removing the namespace definitions from the td and div tags.

I would probably also have gone with a Code Snippet and line numbers to display a log file rather than using a table and divs. It seems like a lot of overhead.
Trent.

Certifiable.

Image

umm...
I meant MAD Certified.

Official Propeller Beanie Owner :-)

:flare: Are you on Flare's Slack channels? PM me for an invitation! :flare:
Mark Propellerhead
Propeller Head
Posts: 15
Joined: Fri Feb 21, 2014 10:06 am

Re: Flare interprets tag in preformatted code text

Post by Mark Propellerhead »

FYI - in case anyone else runs into this, I just cut the offending tags into a text editor so the XML turned valid, then copied them back into the Flare WYSIWYG window. Problem solved.

Btw, I can't use a code snippet because there are hundreds of log samples and there is no time to manually apply a code snippet to each one. I wasn't able to figure out how to mass-apply code snippets. I tried concatenating the table cells with a prefix/suffix and using regular expressions, but the code snippet HTML is multi-line. If there is a way to do it (mass-apply code snippets) I'm all ears.
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Flare interprets tag in preformatted code text

Post by NorthEast »

The < and > symbols are reserved characters in XHTML, so you need to use &lt; and &gt; in the code.
When you paste in the XML Editor view, Flare converts that for you.

I'd agree that the formatting looks over complicated - there's a table, two divs, a pre tag, and code tag.
So how are you copying the log file examples into Flare, and applying all those tags? It looks more complex than using a code snippet.

Anyway, it shouldn't be that difficult to format using a code snippet. If you're copying/pasting the code, then create a pre tag, then paste the whole block of code into the pre tag - using the paste option 'Paste Inline Text'.

After you've inserted all the code examples in pre tags in your project, you could convert the pre tags to code snippets using Flare's Find and Replace > Find Elements. The Find Elements tab has options to do things like replace tags (using set), and wrap tags - so you could create the structure of the <MadCap:codeSnippetBody> and <MadCap:codeSnippet> tags.
Mark Propellerhead
Propeller Head
Posts: 15
Joined: Fri Feb 21, 2014 10:06 am

Re: Flare interprets tag in preformatted code text

Post by Mark Propellerhead »

Using Find Elements was helpful. I was able to use that to find pre tags and replace and wrap the codesnippet tags as you suggested. Thank you!
trent the thief
Propellus Maximus
Posts: 613
Joined: Wed Feb 01, 2006 6:21 am
Location: Off in the dark....

Re: Flare interprets tag in preformatted code text

Post by trent the thief »

As @Northeast mentioned, working outside Flare might be a better option if you're doing complex things and need to manipulate text in Flare files.

I poke into my file quite a bit as there are things that Flare can't accomplish on its own. Thinks like programmatically modifying conditionals inside Flare's target files to produce a series of outputs whose differences are based on the conditional tags. I sued that to generate a batch of word review files for different scrum teams.

Messing about in the files isn't for everyone and it is tedious at times, but is always faster for significant changes than trying to accomplish the same task in the GUI. If only because you don't need to deal with the plethora of confirmation dialogs that Flare spits out.
Trent.

Certifiable.

Image

umm...
I meant MAD Certified.

Official Propeller Beanie Owner :-)

:flare: Are you on Flare's Slack channels? PM me for an invitation! :flare:
Post Reply