which when processed as part of ^text^ will encode as:
<p>Name: j.doe@example.com</p>
which then should look correct in preview mode.
TL;DR—the Preview window is essentially showing an exported HTML page but without needing to do the export. so think ^export^ code (which of course can access attributes via ^value()^ and embedded action code.
to give Name: j.doe@example.com with the latter being a clickable link opening your email client with an email to ‘j.doe@example.com’. Or (working from memory):
to get Name: John X. Doe with the latter being a clickable link opening your email client with an email addressed on-screen to ‘John X. Doe’ via email address ‘j.doe@example.com’
Sorry for the questions. I’m just trying to avoid a few rounds of “one more thing” to get the the right end point.
I don’t want this to be a functioning link. I want it to simply show the text "Name ". How do I comment the <…> so that prevview shows this as text and does not read it as HTML.
put <code></code> tags in the $Text around the code samples, ^text^ export will retain these and cause the (preview) browser to render that text in monospace font. If you have discrete lines of code (i.e. with line breaks between lines) use <pre>/</pre> instead. See more on exporting code samples.
OK, sadly we don’t have a definite example string, so I’ll assume you have an $EmailAddress value with a string like "<j.doe@example.com>". We want it to export as "<j.doe@example.com>" to the angle brackets show as literal characters on screen. Here is our $Text:
On the shores of Gitche Gumee,
Of the shining Big-Sea-Water,
Name: ^value(escapeHTML($EmailAddress))^
which exports as:
<p>On the shores of Gitche Gumee,</p>
<p>Of the shining Big-Sea-Water,</p>
<p>Name: <j.doe@example.com></p>
which renders as :
On the shores of Gitche Gumee,
Of the shining Big-Sea-Water,
Name: <j.doe@example.com>
See more on escapeHTML(). Remember, inside ^value()^, it is literal text, values from attributes or action code. So, we need to add HTML encoding of HTML mark-up-like characters—e.g. angle brackets—in the $EmailAddress whilst still in action code context before exporting the result to the HTML output (now in HTML-safe form) via the ^value()^ call.
Sorry, I don’t mean to be difficult. This is just not working for me. To be clear, I’m not trying to do this in an export template, I’m trying to do this in $Text. I want the code to be displayed as text.
The argument to escapeHTML must be a string. But you can’t put this particular string into either single or double quotes, because it contains both single and double quotes.
Instead, put it in a string attribute, and use ^value(escapeHTML($ThatAttribute))
However, if I have numerous examples of code in one not the I need to create a bunch of code attributes. This does not feel efficient. Totally admit I may be missing some big aha insight.
Think about it from the point of view of the program.
You: “Say cheese!”
Tinderbox: cheese!
You: Say “Mary read ‘War and Peace’ yesterday.”
Tinderbox: Mary read ‘War and Peace’ yesterday.
You: Say “Another good book is ‘“Hello”, He Lied’ by Lynda Obst.”
Tinderbox: “Another good book is '”
You: What gives?
Tinderbox: I said what you told me.
You: That’s not what I meant.
Tinderbox: I started at the quotation mark, and continued to the matching quotation mark.
As illustrated above, however many escape mechanisms you have, examples will still need to escape the escapes. And here, we’re talking about special parsing by Tinderbox and also by HTML.
Your longer awk example can be handled the same way – use TextSoap or an online tool that will entity-encode text for you. Search for “HTML entity encode online” and several options will pop up.
I’m working on creating a format for memorializing my Tinderbox use cases and solutions. In addition to helping me with the code insertion (see Parse Names, Parse Emails, Considerations) issue, can you also take a look at three others?
First, I did try the suggestion in the Parse Names note, but it ends up turning all my preview formatting through the document to code format. It does not work at all for the Stamp examples; the only thing that works for this is the attribute insertion idea Mark provided.
Secondly, any idea on the best way to handle embedded images in a demo file like this? I’d love to have the images exportable, but I can’t do this if the file is shared with others as the images will be on my hard drive.
Thirdly, any ideas on how to improve this use case explanation format? I’d like to create more of these. I think they’ll be useful for others, they give attribution to those that help, and I learn a lot!