Variables - escape or pereplace

Started by JohnZeman, September 17, 2013, 01:42:48 AM

Previous topic - Next topic

JohnZeman

Reference Info Tips:

From what I gather from the help it seems to me the following two lines of code should each display a description formatted with line breaks between paragraphs however only the first one does.  Am I missing somnething?

{File.MD.Composite\Description\Description\0|escape:true}

{File.MD.Composite\Description\Description\0|pereplace:{cr}{lf}==<LineBreak/>;prefix:;postfix:}

I wanted to use the second example so I could also set the font color and size of the description.

Mario

#1
This is best demonstrated like this:



1. Without escape, the file window tip performs the default escaping (because it needs to prevent unsafe metadata from breaking the layout)
2. escape:false => only escape unsafe characters. No change here because the file window info tip does it automatically
3. escape:true => also replace CR/LF pairs with <LineBreak/>

This function is to be used for XAML rendering like in the File Window Info tip or the Batch Processor, and there mainly in the form escape:true to indicate that you want CR/LF to be replaced by <LineBreak/>

[attachment deleted by admin]
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

I took that example over into the help file as well.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

JohnZeman

Ok, apparently I misunderstood the help page on this.  In the help screen shot below I misinterpreted the area in yellow to mean I could use pereplace instead of escape for info tips.  Now I understand escape is only for xml and not xml/html.

[attachment deleted by admin]