Live Preview Breaks After Quoting Text Enclosed in <>

Steps to reproduce

  1. Create a new note
  2. Embed image
  3. Quote the following text: name prefix is <foo>-<bar>
  4. Embed image and notice that live preview no longer works

Screen Capture:

Did you follow the troubleshooting guide? [Y/N]


Expected result

I expect for live preview within the editor to continue working.

Actual result

Live preview failed to preview images and links.


	Obsidian version: v1.4.16
	Installer version: v1.4.16
	Operating system: Darwin Kernel Version 23.1.0: Mon Oct  9 21:32:11 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T6030 23.1.0
	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

That’s because Obsidian assumes you are trying to mix HTML code with Markdown code (<foo> is considered an open HTML tag and must be closed with a corresponding </foo> tag, same for <bar> that requires a </bar>, in which case the image will show up just fine)

Solution: to avoid this, you must escape any HTML tag with a \ prefix, like so: \<foo>-\<bar>; this will tell Obsidian that you are NOT trying to mix HTML with markdown code, and that you actually want the angled bracket (even this forum will not allow you to type <foo>-<bar> without escaping the open-angled bracket)

So no, this is not a bug, this is just a consequence or side effect of Obsidian users being allowed to use both HTML and markdown code inside a note. This happens in other markdown apps as well, not just Obsidian.


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