Closed DesignThinkerer closed 2 months ago
With the $:/tags/RawMarkupWikified/TopHead
the content is wikified before being injected, so you end up with this in the TW file:
...
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!--~~ Raw markup for the top of the head section ~~-->
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true});
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta name="application-name" content="TiddlyWiki" />
...
If you use the $:/tags/RawMarkup
then it works more like you want it to, but it will be inserted at the bottom of the <head>
element not the top.
...
<!--~~ Raw markup ~~-->
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true});
</script>
</head>
...
So I suggest you use $:/tags/RawMarkup
. I'm not sure how to insert unwikified content at the top of the <head>
element, but perhaps there is a way.
There might also be a way to have the wikified content have the required Githubissues.
I was trying to use the mermaidjs library to render mermaidjs diagram in my wiki. In order to load the mermaidjs code, I used the tag RawMarkupWikified, and this caused tiddlyhost to make the wiki unavailable (I thankfully did a backup before attempting to do this so I did not lose anything).
Steps to reproduce:
Create a tiddler with the tag
$:/tags/RawMarkupWikified/TopHead
And the content
On the next page load, this error is displayed:
For now I'm using a macro as a workaround: