I want to use square brackets as normal without having to escape them. Markdown should only treat square bracket text as a link IF it is followed by ().
The issue in the editor (there’s no issue in Reading view) is that single square brackets are in a state of limbo until you do something with them. They could become a [markdown](link.md), a [reference]: link, a [^footnote], and so on.
The CSS assigned to [something] is cm-hmd-barelink, so you could try this for the time being:
Yeah, this is a quirk of Live Preview’s syntax highlighting — it’s highlighting too eagerly. WhiteNoise’s comment doesn’t make sense to me. Fortunately we can work around it with CSS snippets (I use the non-nested one that trainbuffer posted).
What’s the markdown in that note? It looks as if 94 and 114 are internal links and have double brackets[[94]] [[114]]? If they were single brackets, you would see the brackets themselves.
This topic is about single [square] brackets on their own and how Live Preview treats them.
Apologies! I saw the notification post on my phone and quickly replied on the laptop without scrolling up. Yeah, something is odd about how Live Preview is handling the consecutive single brackets.
[La choucroute est une] [[Lacto-fermentation|Fermentations lactiques]] des [[Fructoses]] et [[Glucoses]] par les [[Bactéries]]
La baisse pH du aux [[Acides lactiques (LA)]] évite la production de [[Micro-organismes|microorganismes]] pathogènes
Source : INRAE, 2023 - Ressources #3
One internal link is not visible, and it breaks the sentence (in French). Furthermore, as previously identified, the text inside single square brackets is erroneously displayed as a link.
Backtiks are easy to add, just select a word/sentence and type ` once to enclose the whole.
The point here is, to not lose multiple strings in brackets, if they appear in a sequence.
I understand, Backtiks are more in use by developers, still, you may try it too; anyway that’s just my suggestion.
The issue in the editor (there’s no issue in Reading view ) is that single square brackets are in a state of limbo until you do something with them. They could become a [markdown](link.md) , a [reference]: link , a [^footnote] , and so on.
This doesn’t seem all that relevant to me. They should simply behave like normal text unless they are one of these things.
I agree completely. Single brackets serve a different purpose in prose than parentheses, and we should be able to use them freely without having to resort to escape characters and css hacks.
This behavior might make sense in a code editor but not in an app designed for note-taking and writing.
I know there have been a lot of posts about this, but they all seem to be locked. Some are even bug reports where the only response is “not a bug” with no explanation about why it’s not considered a bug.
Because of the way the parser works, you can even end up in situations where the next word is not rendered. For example, the following will render “[Foo]” as a link, but “[Bar]” will not be rendered at all in the live editor.
I really think there is a bug in the markdown parser. User’s shouldn’t need to manually escape uses of brackets.
Both “[Foo]” and “[Bar]” should render as plain text, not a link.
Actual result
“[Bar]” will disappear.
Environment
SYSTEM INFO:
Obsidian version: v1.6.5
Installer version: v1.4.13
Operating system: Darwin Kernel Version 24.0.0: Mon Jul 1 21:58:14 PDT 2024; root:xnu-11215.0.132.501.1~1/RELEASE_ARM64_T6000 24.0.0
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
This is specifically a quirk of Live Preview. If you switch to Reading View (which typically renders more correctly because it’s not also trying to be a text editor made of lines), you’ll see the text as expected.
Live Preview is highlighting what looks like an incomplete reference-style link. You can probably work around it for now by “escaping” one of the brackets by placing a backslash before it.
Similar/same issue: The display text of a markdown link will be hidden in live preview if different bracketed text comes before it separated by only a single space.
In the following example [Display me] [Also display me](www.example.com) [Also display me] will be completely hidden and the link might not function properly either.
Current fix: Add a separate space or a different character between the two bracketed snippets like [Display me].[Also display me](www.example.com)