Incorrect preview of `<url>` link in last line of document

Incorrect preview of <url> link in last line of document

Steps to reproduce

  1. Create a new document, paste following markdown:
[Obsidian Forum](https://forum.obsidian.md/)
<https://forum.obsidian.md/>
https://forum.obsidian.md/
<https://forum.obsidian.md/>

Make sure that last line does not have linebreak (CR/LF or whatever your line endings are),
i.e. the last > in the last URL is the last character in the document.

  1. Position cursor somewhere before the last line.

  2. Observe the rendering of the last line preview.

Expected result

Link is rendered as underlined https://forum.obsidian.md/

Actual result

There is a trailing > character at the end.

If I add a linebreak after the final line, trailing > disappears from the preview.

Environment

SYSTEM INFO:
	Obsidian version: v1.2.7
	Installer version: v1.2.7
	Operating system: Pop!_OS 22.04 LTS / 6.2.6-76060206-generic
	Login status: logged in
	Catalyst license: supporter
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Last line in edit mode:
md-url-edit-mode

Last line in preview mode (cursor positioned before the last line):
md-url-preview-mode

This is purely a cosmetic issue, and a very minor one at that.

I would not mind if Obsidian forced last line break in the document, in fact I do exactly that in most of my text files using EditorConfig plugin in VSCode / SublimeText etc.

[*]
end_of_line = lf
insert_final_newline = true

Confirmed on iPadOS.

Steps to reproduce

  1. in sandbox vault
  2. create a new file
  3. set contents to
some text
<https://www.google.com>

Leave no newline at end of document

  1. move cursor off the URL link so live preview renders the line without markdown <> showing

Expected result

https://www.google.com should render without the beginning and closing angle brackets in live preview.

Actual result

Renders as

https://www.google.com>

Environment

Sandbox vault

SYSTEM INFO:
	Obsidian version: v1.3.5
	Installer version: v1.3.5
	Operating system: Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000 22.5.0
	Login status: logged in
	Catalyst license: vip
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none


Additional information

CleanShot 2023-06-06 at 13.08.55

Adding a newline after the URL link convinces live preview to render as expected.

1 Like