Editor and Reading view disagree on 13 edge-case notes (one report for all of them)

Steps to reproduce

Each item below is a minimal note. Paste one into an empty note, look at it in Source mode and Live Preview, then in Reading view. These only show up in notes that are unusual on purpose. When I tried the realistic version of each one, both views agreed. So this is one report with all 13 instead of 13 separate posts, for whoever works on the editor’s parser.

  1. Four dollar signs:

    $$$$
    text
    
    • Editor: $$$$ is an empty display math block and text is plain text.
    • Reading view: $$$$ opens a math block that runs to the end of the note, and text is rendered as math. The metadata cache also has one math section covering both lines.
  2. A tilde fence whose info string holds a backtick:

    ~~~a`
    code
    ~~~
    
    • Editor: no code block opens. ~~~a is read as strikethrough, code is struck through, and the closing ~~~ opens a code block that runs to the end of the note.
    • Reading view: a code block with the info string a` . CommonMark allows a backtick in the info string of a tilde fence.
  3. An indented line after an empty quote line:

    > quote
    >
        code
    
    • Editor: the quote carries on to the indented line as a lazy continuation line.
    • Reading view: the quote ends at the empty > line, and code is an indented code block.
  4. --- under [1]:, which has no destination:

    [1]:
    ---
    
    • Editor: [1]: is styled as a footnote definition and --- as a horizontal rule.
    • Reading view: [1]: is a level 2 heading, which is also in the metadata cache’s headings. [1]: with no destination is not a definition.
  5. Five spaces after a list marker:

    -     code
    
    • Editor: list item text.
    • Reading view: an indented code block inside the list item, as CommonMark specifies.
  6. A line right after indented code:

        code
    [[Note]] and #tag
    
    • Editor: [[Note]] is styled as a […] bare link around [Note], not as an internal link, so Live Preview does not show it as a link to Note. The tag is fine.
    • Reading view: a paragraph with a working link to Note, and the metadata cache has that link.
  7. An indented line after an empty list item and an empty line:

    -
    
        text
    
  8. Indented code right after a horizontal rule:

    ***
        code
    
    • Editor: code is plain text.
    • Reading view: an indented code block, as CommonMark specifies.
  9. A highlight that is closed only on the next line:

    ==a
    ==b==
    
    • Editor: highlights a, closes the highlight at the == that starts the second line, and leaves b== as text.
    • Reading view: highlights a ==b across the line break.
  10. A highlight closer after a space:

    ==a ==b==
    
    • Editor: closes the highlight at the == after the space, so it highlights a and leaves b== as text.
    • Reading view: highlights a ==b.
  11. A table whose only header cell is empty:

    ||
    |-|
    
    • Editor: two lines of plain text, and Live Preview shows no table.
    • Reading view: a table with one empty header cell, which the metadata cache also lists as a table section.
  12. $ marks in two different table cells:

    | $a | b$ |
    |---|---|
    
    • Source mode: styles $a in the first cell as math, though nothing in that cell closes it.
    • Reading view and the Live Preview table widget: $a and b$ are both plain text.
  13. Four opening brackets before an internal link:

    [[[[Note]]
    
    • Editor: links to Note, with an extra [[ drawn inside the link.
    • Reading view: a literal [, then a link to [Note. The metadata cache has the same link, to [Note.

Did you follow the troubleshooting guide?

Yes. A fresh sandbox vault with no community plugins and the default theme and settings.

Expected result

Source mode, Live Preview and Reading view read each note the same way.

Actual result

They disagree as described under each item. I got the same results on 1.15.0 and on 1.15.1 (Catalyst).

Environment

SYSTEM INFO:
	Obsidian version: 1.15.0
	Installer version: 1.14.4
	Operating system: Windows 11 Pro 10.0.26300
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 0
	Plugins enabled: 0

RECOMMENDATIONS:
	none

Additional information

None of these is urgent. I’m reporting them together so they are written down in one place. If you would rather have any of them as a separate report, I’ll split it out.

1 Like