Replies: 2 comments 3 replies
-
It would be helpful if you share both what you are trying to accomplish, as well as the contents of your template. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Hi @kilomeow by default the parser will assume the text is in block mode, which means that You can force inline mode as follows which will restrict the parser to inline parsing rules: var parser = $tw.wiki.parseTiddler("$:/my/template",{parseAsInline: true}),
widgetNode = $tw.wiki.makeWidget(parser,
{ variables: {currentTiddler: "$:/my/tiddler"}}),
container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my widget code I'm trying to render some tiddler using template:
$:/my/template
starts with pragma\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline html
so it's parsing correctly and it works. However, in a result I get a lot of<p>
tags from template code.I tried to use
{parseAsInline: true}
as an argument toparseTiddler
but for some reason it doesn't work in any way -- I'm still getting a lot of<p>
tags which mess resulting html. How to build a good template parser?Beta Was this translation helpful? Give feedback.
All reactions