I have some frequent use cases in which the automatic creation of tags from the body of my notes is an issue. One is from color codes (requested and discussed elsewhere), but another that I have not seen discussed is tags created within code blocks.
The semantics of a # in a code block are different from those in the markdown body - once in a code block, it’s not markdown anymore (unless, I suppose it’s in a “```markdown” block).
Blocks of CSS, C, C++, etc. result in the automatic creation of many tags that clutter my UI. For example, C code frequently results in “define”, “ifdef”, “ifndef”, etc. tags because “#define” etc are very very common in C. Color codes in CSS are similar.
I’m aware that they can be escaped, and I can accept doing that in the body of the markdown, but having to escape them in code blocks means that:
it’s no longer valid code for its language, so it cannot be copy/pasted, etc.
if I ever copy/paste code into markdown, I have to manually escape, and update that manually if I ever have to update the code block
There may be arguments to support automatic tag creation from within code blocks, but I can’t think of any.
Most probably a recent problem, I’m not yet using Obsidian v1.8. x
On my Linux machine, Hashes # are rendered correctly in fenced code blocks, eg
#!/bin/bash
#some comment
echo "Hi"
If you want my opinion, don’t bother yourself and try to download some community plugin to solve this problem, example: HK code block by Heekang Park.
Also try codeblock customizer or something similar.
If you don’t like plugins, consider to open a bug report instead of a feature request.
Unfortunately I have many sections of code in many notes that is in blockquotes (imported from somewhere else). But that’s a me problem, not an obsidian problem.