How do I prevent html escaping when using ViewTemplate tag to make templates

57 views
Skip to first unread message

Cyrus Murphy

unread,
Mar 3, 2016, 11:44:00 PM3/3/16
to TiddlyWiki
I have a template that I want to use whenever a tiddler has "testtag" tag. I have it tagged with "$:/tags/ViewTemplate" (see attached template.gif). Here's the contents:

<$list filter="[is[current]tag[testtag]]">
test

<<<
indented text
<<<

*test list item 1
*test list item 2

---

<hr>

what's up
</$list>

I am expecting that all "testtag" tagged tiddlers will show the wikitext formatting but the HTML is getting escaped in the process so that <<< is turning in to &lt;&lt;&lt; for example. See attached testtag.gif to see how the tiddler is being formatted. 

Is there anyway to prevent this behavior?

 
template.gif
testtag.gif

Eric Shulman

unread,
Mar 4, 2016, 12:37:35 AM3/4/16
to TiddlyWiki
On Thursday, March 3, 2016 at 8:44:00 PM UTC-8, Cyrus Murphy wrote:
I have a template that I want to use whenever a tiddler has "testtag" tag. I have it tagged with "$:/tags/ViewTemplate" (see attached template.gif). Here's the contents:

<$list filter="[is[current]tag[testtag]]">
test

...

The content isn't actually being "escaped".  The problem is that the content inside the <$list> widget is being output using "inline mode", and some of the formatting (such as the "<<<" for blockquotes) only works in "block mode".  To fix this, simply add a blank line between the opening <$list> widget and the "test" text that follows, like this:
<$list filter="[is[current]tag[testtag]]">

test

That will force the content inside the $list into block mode, allowing all the formatting syntax to be parsed as intended.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals

Cyrus Murphy

unread,
Mar 4, 2016, 12:31:09 PM3/4/16
to TiddlyWiki
Perfect, just what I needed! Love banging my head on things because of one carriage return.
Reply all
Reply to author
Forward
0 new messages