Forgive me , But I still don’t understand the purpose of this construction; Here are a few tips that may lead to a solution,
- Some widgets actually accept a html tag as a parameter, such as the button widget. So setting this you can determine which tag is used to wrap the content.
- Html sections and all html tags including arbitrary tags can be used in wikitext quite freely, as long as you honour the correct closing tags.
- All class and style tags are operational, the only thing that does not work with html is interactions that need javascript. We have smarter ways.
- Commonly when you do this we use CSS to determine if it is displayed or not. eg
display: none;
- list and reveal can conditionally display text, wikitext or HTML, in the following example if the current tiddler has one or more tags. The content can just be html, as can be a tiddler using the list widgets template parameter.
<$list filter="[all[current]tags[]limit[1]]" variable=nul>
<section>
Content of section
</section>
</$list>
Installing the core plugin TiddlyWiki Internals as on tiddlywiki.com adds an additional editor preview that shows how the tiddler gets rendered into html. this will help you see the results once tiddlywiki has its way with the content.
If you do use a list widget you need to leave a blank line before using wikitext so that tiddlywiki puts it into block mode.
Eg
<$list filter="[all[current]tags[]limit[1]]" variable=nul>
* List item
</$list>
the above works, but the following fails to render the wikitext “*” as a list item <li></li>
<$list filter="[all[current]tags[]limit[1]]" variable=nul>
* List item
</$list>
- If you use the raw HTML preview you can see what tiddlywiki’s render process does. Unless it know better it often wraps things in a the
<p></p>
tags
The reverse also works
<section style="display:none;">
Section containing list widget
<$list filter="[all[current]tags[]limit[1]]" variable=nul>
* List item
</$list>
</section>
But not until you remove the display: none;
Wiki text will not work correctly unless it knows which mode its in inline or block
<section style="display:none;">
Section containing list widget
<$list filter="[all[current]tags[]limit[1]]" variable=nul>
* List item
</$list>
</section>
The following fails to render the wikitext
<div>
;Heading
:detail
</div>
This following does not;
<div>
;Heading
:detail
</div>
This is a personal opinion, but tiddlywiki ultimately passes through most html (not javascript/onclick etc) so you gain the power of tiddlywiki and most of html at the same time. With ample Widget support for the rest. Html in tiddlywiki is more powerful in tiddlywiki than outside it.
- You just need to learn some exceptions because tiddlywiki needs to also interpret its own markup, macros and widgets.
As is common from me, I would rather know what you are trying to achieve than what you are trying to fix, if I had a better idea of what you want to achieve, rather than you asking how to do something a particular way, a way I think may be based on a misunderstanding, I suspect I can answer.
- What is the root cause or desired outcome?
[Edited] see also https://tiddlywiki.com/#HTML%20in%20WikiText
especialy
Attributes
In an extension of conventional HTML syntax, attributes of elements/widgets can be specified in several different ways:
The above allows you to use wikitext to provide attribute values to html.