PUtting html DIV tags in a macro causes html P tags to Surround

41 views
Skip to first unread message

David

unread,
Apr 29, 2020, 10:55:49 AM4/29/20
to TiddlyWiki
I was using this code and it was producing a nice list (<<chk0>> is a blank checkbox glyph via font awesome)

<div class="faHang"><<chk0>> Zenith silvertip</div>

I could stack those on top of each other and have a good single-spaced list.

I decided to make a macro that made that code more concise.  I love that about TW.  So here's my macro.... 

\define faHang( bulletMacro:chk0 content:"test content" )<div class="faHang" ><$macrocall $name="$bulletMacro$" /> $content$</div>

which worked great, except it seems to, in effect, wrap the output of the macro in <P> tags, which double-spaces my list and is not desirable.

For completeness, here's how I'm calling the macro...

<<faHang chk0 """[[Timeless Baseplate Solid bar .68]]  ($60)""">>
<
<faHang chk0 """Whipped Dog 26mm Silvertip""">>



Saq Imtiaz

unread,
Apr 29, 2020, 11:12:41 AM4/29/20
to TiddlyWiki
There might be a better solution, but one option is to bribe the parser and wrap a <p> around those macro calls.

<p>
<<macro>>
<<macro>>
</p>

David

unread,
Apr 29, 2020, 11:21:59 AM4/29/20
to TiddlyWiki
Yes, that worked.  I actually enclosed them all in a <div>, but great work-around until someone thinks of something better.

TonyM

unread,
Apr 29, 2020, 10:41:10 PM4/29/20
to TiddlyWiki
David,

I do not think you need to revert to html to do this but neither am I clear on what the result is you want so not sure how to share.

People do find this automatic `p` tag difficult, but I do not notice anymore with other methods used.

Regards
Tony
Reply all
Reply to author
Forward
0 new messages