Paragraph and div in TW and extra paragraph tags by TW

52 views
Skip to first unread message

Mohammad

unread,
Aug 17, 2018, 7:38:20 AM8/17/18
to tiddl...@googlegroups.com
Assume I have a macro like below

\define info(text)
<div class="tc-doc-info">
<p>
$text$
</p>
</div>
\end

Where the tc-doc-info is a css class as below

.tc-doc-info{
    padding-top: 0.01em;
    padding-right: 16px;
    padding-bottom: 0.01em;
    padding-left: 16px;
    background-color: #e7f3fe;
    border-left: 6px solid #2196F3;
}


Do I need to include the <p> tag inside <div>?  or I can define my macro like below

\define info(text)
<div class="tc-doc-info">$text$</div>
\end



See this example

This is a text

<<info "I love Tiddlywiki for its simplicity">>

This is another text!



It seems when TW renders the above wikitext it also wrap this into extra paragraph

-Mohammad

PMario

unread,
Aug 17, 2018, 8:39:17 AM8/17/18
to TiddlyWiki
Hi,

2 line-breaks create a new paragraph. .. That's by design.

TW uses 2 CR to identify "block" or "inline" mode.


-m

PMario

unread,
Aug 17, 2018, 8:43:25 AM8/17/18
to TiddlyWiki

And paste your code into a new tiddler, you can activate the "preview-mode" ...

It will let you choose more options as tiddlywiki dot com. ...

You'll get "raw HTML", which makes debugging easier.

-m
Reply all
Reply to author
Forward
0 new messages