Keep the # symbol in the rendered title

I am looking for a theme (or plug-in) that keep the # symbol the rendered title /subtitle.

Thus the rendered document would look like

# myTitle
## my Subtitle
Some body content

Try adding \ in front of the hashes (if you use Live Preview). Mind you, the larger headings (the associated CSS) will be gone, so you’d need a new CSS snippet targeting these \# if that’s possible.

Solved !
I made my own css snippet. It work in editor mode with live preview

/*for editor mode with live preview*/
.cm-s-obsidian:not(.cm-formatting-header) .cm-header.cm-header-1::before {
    content: "# ";
}
.cm-s-obsidian:not(.cm-formatting-header) .cm-header.cm-header-2::before {
    content: "## ";
}
.cm-s-obsidian:not(.cm-formatting-header) .cm-header.cm-header-3::before {
    content: "### ";
}
.cm-s-obsidian:not(.cm-formatting-header) .cm-header.cm-header-4::before {
    content: "#### ";
}

/*corner case, when editing cell, prevent duplicate #*/
.cm-active.HyperMD-header.HyperMD-header-1.cm-line ::before {
    content:  normal !important;
}
.cm-active.HyperMD-header.HyperMD-header-2.cm-line ::before {
    content:  normal !important;
}
.cm-active.HyperMD-header.HyperMD-header-3.cm-line ::before {
    content:  normal !important;
}
.cm-active.HyperMD-header.HyperMD-header-4.cm-line ::before {
    content:  normal !important;
}


I was thinking about suggesting something like that, but I don’t like the live preview CSS selectors… They’re ugly…

You could change the line above to the following to also get this for reading mode:

h1::before, .cm-s-obsidian:not(.cm-formatting-header) .cm-header.cm-header-1::before {
    content: "# ";
}   

That is add h#::before, in front of each line to get it to work in reading mode. By the way, is it intentional that you only change the active header in live preview and not all headers?

no its just that I personnaly only use live preview, and considered it finished when this part was working, thanks for your suggestion

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.