photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: JohnZeman on September 17, 2013, 01:42:48 AM

Title: Variables - escape or pereplace
Post by: JohnZeman on September 17, 2013, 01:42:48 AM
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.
Title: Re: Variables - escape or pereplace
Post by: Mario on September 17, 2013, 07:58:16 AM
This is best demonstrated like this:

(https://www.photools.com/community/index.php?action=dlattach;topic=882.0;attach=1811;image)

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]
Title: Re: Variables - escape or pereplace
Post by: Mario on September 17, 2013, 08:17:39 AM
I took that example over into the help file as well.
Title: Re: Variables - escape or pereplace
Post by: JohnZeman on September 17, 2013, 02:35:13 PM
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]