Jump to content

markup tags displaying in Rich Text Editor (RTE)


JoyceKeller

Recommended Posts

This may or may not have something to do with a JavaScript Rule in my text field.

 

As long as I enter text in the RTE without breaks or other formatting, the result returns expected results:

 

My text entered here. It does what it is supposed to do. It displays as I expect it to display.

 

As soon as I enter a line break and refresh the preview, the following is displayed:

 

<p style="" quad="L" br="false"> My text entered here. It does what it is supposed to do. It displays as I expect it to display. Now I will enter a break.</p>

<p><br><p>

<p style="" quad="L" br="false">And the text is now displayed with markup tags from the RTE.</p>

 

 

Does anyone know why this happens so I can fix it?

 

The rule in my text field is this:

 
[color=seagreen]//code credit: Dan Korn[/color]
[color=seagreen]//first sentence color is replaced[/color]
[color=blue]var[/color] [color=black]s = [color=dimgray]TaggedTextFromRaw[/color]([color=dimgray]Field[/color]([color=#8b0000]"maintxt"[/color]));[/color]
[color=blue]return[/color] [color=black]s.replace([color=magenta]/([^\.\?\!]+.)/[/color],[color=olive]'<color name="purple">$&</color>'[/color]);[/color]

 

see 12797 about making the first sentence of body text change color

Link to comment
Share on other sites

I'll bet that the field "maintxt" already contains tagged markup, which is being treated as literal text because you're calling TaggedTextFromRaw. (You can verify this by simply changing the second line to "return s;", without quotes.)

 

If this is a job which you designed in Creator (Desktop) with flat-file data, and you're uploading it to MarcomCentral or some other web-to-print system which generates tagged markup input data for FusionPro, then you need to account for those differences in the input file formats. Fortunately, there's a very simple way to do this: call TaggedDataField instead of TaggedTextFromRaw and Field, like so:

var s = TaggedDataField("maintxt");
return s.replace(/([^\.\?\!]+.)/,'<color name="purple">$&</color>');

Edited by Dan Korn
Never mind, this is the MarcomCentral forum. :^)
Link to comment
Share on other sites

Hi Dan,

We upload to MarcomCentral and it makes perfect sense that I need to account for generated tagged markup.

 

I've learned something new about calling TaggedTextFromRaw or TaggedDataField.

 

Other than what you have taught me today, the only other reference I can find for TaggedTextFromRaw in the FusionPro RulesSystemGuide.pdf on page 81 and in the UserGuide on page 140. I'll keep reading, though.

 

Thank you for being generous with your time and knowledge.

Your solution is a perfect fit.

Link to comment
Share on other sites

×
×
  • Create New...