Second word of second footnote turns green

Bug discovered by @guysimtheprinter in the Obsidian discord.

Steps to reproduce

  1. Create new note
  2. Copy/paste the following text in:
[Footnote1]: Test
[Footnote2]: Test test test

Expected result

No green text

Actual result

2023-04-24-104756_594x185_scrot

This happens in both Live Preview and Source Mode.

2023-04-24-104846_493x156_scrot

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.

2023-04-24-105354_365x136_scrot

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

thanks