How to avoid <p> tags generated when using ViewWidget on tiddlers with html code

63 views
Skip to first unread message

Adithya B M

unread,
Aug 4, 2020, 10:25:01 AM8/4/20
to TiddlyWiki
Hi All,

Im trying to generate a website from TW using the tutorial at https://www.didaxy.com/exporting-static-sites-from-tiddlywiki-part-2

I am facing a problem when using the view widget to import html from different tiddlers. When doing that, the widget adds a <p>...</p> around the content. This breaks the flow of the content.

Screen Shot 2020-08-04 at 7.50.41 PM.png

The tiddler in question doesnt have the p tags. It starts from the <ul> tag. How to avoid this problem?

Thanks in advance!
Adithya


Mark S.

unread,
Aug 4, 2020, 12:51:14 PM8/4/20
to TiddlyWiki
I notice that there is a line break after the tick ` . I wonder if that could be introducing a <p> ? I notice the tutorial doesn't insert that break.

Adithya B M

unread,
Aug 4, 2020, 1:36:53 PM8/4/20
to TiddlyWiki
The problem is there even on a a blank Tiddlywiki. The <p> tags are inserted even though the 'Hello' tiddly contains only the <ul>....</ul> content.
Screen Shot 2020-08-04 at 11.05.28 PM.png

Eric Shulman

unread,
Aug 4, 2020, 1:44:27 PM8/4/20
to TiddlyWiki
On Tuesday, August 4, 2020 at 10:36:53 AM UTC-7, Adithya B M wrote:
The problem is there even on a a blank Tiddlywiki. The <p> tags are inserted even though the 'Hello' tiddly contains only the <ul>....</ul> content.

Perhaps you can use normal transclusion, and leave the HTML generation for the static export process.  Thus, instead of writing
<$view tiddler="Hello" format="htmlwikified" />
you could write:
<$transclude tiddler="Hello" mode="block" />
or maybe even just
{{Hello}}

-e

Adithya B M

unread,
Aug 4, 2020, 2:01:12 PM8/4/20
to TiddlyWiki
Hi Eric,

That doesnt solve the problem since the transclusion renders the html instead of printing just the code. The code is needed because this tiddler is extracted into a html file and used to build a website.
Screen Shot 2020-08-04 at 11.28.16 PM.png

Cheers,
Adithya

Ton Gerner

unread,
Aug 4, 2020, 4:01:23 PM8/4/20
to TiddlyWiki

Adithya B M

unread,
Aug 4, 2020, 4:38:45 PM8/4/20
to TiddlyWiki
That works! With the addition of the 'output="html"' parameter :)

<$wikify name="output" text={{111}} mode="inline" output="html">
<$text text=<<output>>/>
</$wikify>

Do you think this could be shortened into a macro call?
Reply all
Reply to author
Forward
0 new messages