Erratic handling of nested square brackets in live preview

There are bug reports of people not liking the way things in non-escaped single square brackets are highlighted (see this and this). I don’t think they should be highlighted either, but I realise that’s just a personal preference!

But preference aside, live preview is currently handling nested non-escaped square brackets erratically. Reading view displays everything perfectly sensibly and consistently so I’d describe this as a bug/set of bugs rather than personal preference. I hope I’ve managed to document this well!

Steps to reproduce

Here’s a test note in a brand new vault that has had nothing doing to it other than toggling live preview on:

Square bracket testing.md (1.6 KB)

Here’s a screenshot of live preview:

Expected result

  1. Works fine.
  2. Works fine.
  3. Opening internal link brackets hidden; closing single bracket should be grey.
  4. Works fine.
  5. Single square brackets should be visible; the text that’s not a link shouldn’t be underlined; the external link should be displayed as usual.

Actual result

  1. Works fine.
  2. Works fine.
  3. You can still see the opening double brackets for the internal link; the closing single bracket is black when it should be grey to match the opening bracket and to match the behaviour in examples 1 and 2.
  4. Works fine.
  5. Single square brackets not visible; text that isn’t a link is underlined; the external link is displayed as raw text, not in its live preview form.

Environment

SYSTEM INFO:
Obsidian version: v0.14.5
Installer version: v0.14.2
Operating system: #1 SMP Debian 5.15.15-1 (2022-01-18) 5.15.0-3-amd64
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: light
Community theme: none
Snippets enabled: 0
Safe mode: on

3 Likes

Actual result / 5. Single square brackets not visible; text that isn’t a link is underlined; the external link is displayed as raw text, not in its live preview form.

and it’s not clickable now on 1.1.9.

Filed another report: Links with square brackets don't work in Live Preview

Steps to reproduce

  1. Create an external link with square brackets in the link text, e.g. [[PR-234] - Ticket name](http://google.com)

Bugs

  1. In Live Preview this link is not clickable.

  2. In Live Preview the link should be rendered properly w/o extra square brackets:
    image

SYSTEM INFO:
	Obsidian version: v1.1.9
	Installer version: v1.1.9
	Operating system: #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 5.15.0-56-generic
	Login status: logged in
	Catalyst license: none
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: light
	Community theme: none
	Snippets enabled: 2
	Restricted mode: off
	Plugins installed: 6
	Plugins enabled: 6
		1: Markdown prettifier v0.1.3
		2: Natural Language Dates v0.6.1
		3: Hotkeys++ v0.2.7
		4: RTL Support v0.3.0
		5: Folder Note v0.7.3
		6: Advanced Tables v0.17.0

A similar bug report:

1 Like

Thanks! I edited the title and post to specify that the brackets are in the link text (since links always have brackets).

2 Likes

Thanks!

I’ve wanted to add to this bug report for a while on something related. It’s not nested brackets, but it’s also erratic behavior with multiple brackets one after the other, so it might be related.

When you copy-paste from Wikipedia, for example, they have various references as [1][2][3]. I usually delete them, since I only paste plain text, not the text with all their html links.

In Reading Mode it looks as you would expect, but in Live Preview, that would look like 1[3], and the 1 behaves like a link. When you click on it, it creates a note with [ as a title. :thinking:??

I’ve ignored it for a while, but I think I should add this here, just in case.

Example in the sandbox:

ezgif.com-video-to-gif

Note: I had already done the test, so the [ titled page was already there, but it creates it when first clicked.

Oh, and I’m on Windows.

SYSTEM INFO:
Obsidian version: v1.1.15
Installer version: v1.1.9
Operating system: Windows 10 Pro 10.0.22621
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0