Bug discovered by @guysimtheprinter
in the Obsidian discord.
Steps to reproduce
- Create new note
- Copy/paste the following text in:
[Footnote1]: Test
[Footnote2]: Test test test
Expected result
No green text
Actual result
This happens in both Live Preview and Source Mode.
Environment
SYSTEM INFO:
- Obsidian version: v1.2.5
- Installer version: v1.1.16
- Operating system: #1 SMP PREEMPT_DYNAMIC Thu, 13 Apr 2023 16:59:24 +0000 6.2.11-arch1-1
- Login status: logged in
- Catalyst license: insider
- Insider build toggle: on
- Live preview: on
- Legacy editor: off
- Base theme: dark
- Community theme: none
- Snippets enabled: 0
- Restricted mode: on
Additional information
The green text is green because the .cm-string
class is getting applied to it.
Since .cm-string
is a class for codemirror’s syntax highlighting, I suspect this is an upstream codemirror bug.
The green color goes away if additional text is added to Footnote1 in my example.
Specifically:
[Footnote1]:<space>
[Footnote2]:<space>word<space>word<space>
is not green, but
[Footnote1]:<space>word
[Footnote2]:<space>word<space>word<space>
is green, but
[Footnote1]:<space>word<space>
[Footnote2]:<space>word<space>word<space>
is not, and nor is
[Footnote1]:<space>word
[Footnote2]:<space>word<space>word