Notation Color Blocks Only Works with Legacy Editor
Opened this issue · 6 comments
Notation color blocks don't render when using the live preview, they just stay as code blocks.
Only when using the legacy editor and toggling preview mode do they render.
Tested using minimal theme 5.2 and notation-color-blocks as of commit d8caed4
Hi! did you find a solution when not using the legacy editor?
not a direct solution to use this snipped. I stopped using it and instead have just been marking with obsidian's highlights (==highlight==) or the diff code.
+ this is blue
- this is red
Cool, thanks
How do I use the "+, -" ?
And how do you change the color of the text?
It is not possible to get back the old functionality in the live preview with only CSS snippets. Below is a markdown example and the HTML output that is generated in the live preview window:
```note-gray-background
xxx
```
which gets translated into:
<div class="HyperMD-codeblock HyperMD-codeblock-begin HyperMD-codeblock-begin-bg HyperMD-codeblock-bg cm-line" dir="ltr">
<img class="cm-widgetBuffer" aria-hidden="true" />
<span contenteditable="false"></span>
<img class="cm-widgetBuffer" aria-hidden="true" />
<span class="code-block-flair" aria-label="Copy" contenteditable="false">note-gray-background</span>
<img class="cm-widgetBuffer" aria-hidden="true" />
</div>
<div class="HyperMD-codeblock HyperMD-codeblock-bg cm-line" dir="ltr">
<span class="cm-hmd-codeblock" spellcheck="false">xxx</span>
</div>
<div class="HyperMD-codeblock HyperMD-codeblock-bg HyperMD-codeblock-end HyperMD-codeblock-end-bg cm-line" dir="ltr">
<img class="cm-widgetBuffer" aria-hidden="true" />
<span contenteditable="false"></span>
<img class="cm-widgetBuffer" aria-hidden="true" />
</div>
It is not possible to style an element based on its innerHTML
/content.
But I just found the Admonition plugin, which looks like what I was looking for. Or you could use the built-in Callouts (which I also just found).