Div tags and markdown

Steps to reproduce

Create any file and add the following:


<div markdown="1">

The first one will not bolden the word “test”. The second one will end the div tag right away and not allow anything to actually be inside of the div.

Did you follow the troubleshooting guide? Y

Expected result

The div to contain all of the contents and to be rendered using markdown.

Actual result

When ‘Markdown’ is set, then it automatically closes the

tag and makes the following stuff not work.


Obsidian version: v1.4.16
Installer version: v1.4.16
Operating system: Windows 10 Home 10.0.22621
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on


Additional information

The main issue is that if you add

inside of a markdown page, then it will no longer handle the markdown inside of the div tag. This is “normally” fixed by adding markdown="1". The issue seems to be that when this is set, the
tag is closed right away and so the content “inside” of the div tag is now outside of it according to obsidian, which breaks the interface.

Markdown won’t render correctly in HTML tags. I don’t think this has changed recently. This and probably a bunch of more topics.

Was trying to edit my post above, but I guess you replied before I could. Some additional notes.

When you go into “reading mode” the **test** does appear to be inside of the <div> in both, but in both it gets rendered as **test** instead of a boldened test.

When you go into “editing mode” the first **test** appears as **test**, but the second one gets boldened (because the <div> gets closed right away after adding markdown="1").

If the markdown="1" key can’t be added, then it would be nice for both of them to at least have the same functionality because adding an additional key shouldn’t break the markdown like that. The main issue isn’t necessarily that Markdown won’t render correctly in HTML tags (that’s expected). The issue is that by adding markdown="1", then “editing mode” this is breaking the interface. You can try it in the sandbox to see what I mean by “breaking the interface”.