Use case or problem
I often need to use asterisks ( * ) or colons ( : ) inside of words. This is mainly used for gender-inclusive writing in German. (I know this is a contentious topic, but let’s try to keep politics out of it and assume for some reason or another I have to edit markdown files with this writing style.)
Unfortunately, Obsidian (like most Markdown implementations) consider an asterisk inside of a word to start italics: Bäcker*innen becomes “Bäcker*innen” in the editor and “Bäckerinnen” in the preview.
Current workarounds
The workarounds are all not very satisfying:
Some people have adopted the colon as an alternative: “Bäcker:innen”. It looks less obstrusive and is handled better by markdown implementations and screen readers. However, sometimes the style guide requires the asterisk. Also, I’ve noticed Obsidian sometimes converts words with colons into links, like “Soldat:innen”
You can also escape the asterisk with a backslash, Bäcker\*innen, but Obsidian highlights the backslash in orange and dims out the asterisk. This makes the backslash even more prominent. It also inserts a second asterisk as if you are creating italics.
Proposed solution
A minimal solution would be to fix the syntax highlighting for \*: Dim the backslash, and make the asterisk the normal color.
A possible solution would be to have an option to disable the asterisk mid word, either globally or by using some magic annotation in the file. But I don’t like the idea of creating yet another markdown dialect.
The best solution IMO would be a plugin that transparently inserts the escape characters (combined with the syntax highlight fix). For example:
- If you are at the end of a word and press
*, it inserts an asterisk.
- If you then press another non-space character, it changes the
* to \*
- If you press backspace after
\*, it removes both together.
The tricky thing would be to get all the edge cases right, but I think it is doable.
Related feature requests (optional)