create parser from template tiddler without <p> tags

72 views
Skip to first unread message

Balaram Usov

unread,
Mar 10, 2021, 12:20:31 PM3/10/21
to TiddlyWiki
in my widget code I'm trying to render my tiddler using template:

```
var parser = this.parseTiddler("$:/my/template"),
  widgetNode = $tw.wiki.makeWidget(parser,
        { variables: {currentTiddler: "$:/my/tiddler"}}),
  container = $tw.fakeDocument.createElement("div");

widgetNode.render(container,null);
```
It works. However, in a result I get a lot of <p> tags from template code

Using {parseAsInline: true} as an argument to parseTiddler changes nothing

Balaram Usov

unread,
Mar 10, 2021, 12:50:14 PM3/10/21
to TiddlyWiki
I will appreciate any help! also it's parsing some of my link in tiddler as:
<a class="tc-tiddlylink-external" href="https://my.link/" rel="noopener noreferrer" target="_blank">https://my.link/</a> and it's also breaks my template

среда, 10 марта 2021 г. в 20:20:31 UTC+3, Balaram Usov:

Balaram Usov

unread,
Mar 10, 2021, 12:52:50 PM3/10/21
to TiddlyWiki
setting tiddler type of $:/my/template to "text/html" leads to getting iframe

среда, 10 марта 2021 г. в 20:50:14 UTC+3, Balaram Usov:

Balaram Usov

unread,
Mar 10, 2021, 1:52:15 PM3/10/21
to TiddlyWiki
okay, using \rules only filteredtranscludeinline transcludeinline macrodef macrocallinline html helped me with links and other, but paragraphs are still there and mess my html structure

среда, 10 марта 2021 г. в 20:52:50 UTC+3, Balaram Usov:

Mat

unread,
Mar 10, 2021, 4:29:38 PM3/10/21
to TiddlyWiki
Hi. Your question probably fits better in the dev forum because it goes beyond TW itself: https://github.com/Jermolene/TiddlyWiki5/discussions
Hope you get answers there!
<:-)

Balaram Usov

unread,
Mar 11, 2021, 10:44:47 AM3/11/21
to TiddlyWiki
Thank you for advice. I posted my question there

четверг, 11 марта 2021 г. в 00:29:38 UTC+3, Mat:
Reply all
Reply to author
Forward
0 new messages