Languages with special characters cause inconsistent behavior in code blocks

Steps to reproduce

Create a code block, and set the highlighting language to something with special characters:

  // code

Expected result

I expected to see the code block in the preview to get the corresponding class name language-😎cool😋language❤with💎special🔠characters👽

Actual result

Instead, inconsistent class names are seen. The <pre> gets class=" language-none", while the <code> gets both the expected class but also language-none, as shown:



  • Operating system: Windows 10
  • Obsidian version: v0.12.19

we don’t support this. Open a feature request.