Headers misrecognized and reading mode rendering broken after <div> HTML tag

Steps to reproduce

Create a .md document in Obsidian as follows.

# header A
this is a [[#header A|working link to header A]]

<span>span element</span>
# header B
this is a [[#header B|partially working link to header B]]

<div>div element</div>
# header C
this [[#header C|link to header C that doesn't work]]

Did you follow the troubleshooting guide?

Yes

Expected result

Links work as expected:

  1. clicking a link to a header highlights everything up until but not including the next header
  2. In reading mode, renders header C like other headers

Actual result

  1. Clicking the header B link highlights the rest of the document, including header C and its contents, but excluding the contents of the <div> tag.
  2. Markdown rendering breaks after the <div> element in reading mode.

Environment

SYSTEM INFO:
Obsidian version: v1.6.3
Installer version: v1.5.12
Operating system: Darwin Kernel Version 23.4.0: Fri Mar 15 00:11:05 PDT 2024; root:xnu-10063.101.17~1/RELEASE_X86_64 23.4.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 2
Restricted mode: on

Additional information

This issue also seems to occur with <h1> tags, and I assume others as well.

This is how obsidian works.

Html block elements must be separated from markdown blocks with one blank line on both end.

Thank you. Although I’m sure there’s a reason for this, you must understand that this is not obvious or predictable behavior for users who have not heard this rule. I hope you will consider adding this info to pages like this one, or somewhere where it could be accessible by websearch.

I put it in my todo list.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.