Single square brackets highlighted like links in edit mode

If I use single square brackets in my text, say like this - L[S, C] - the square brackets and the material inside them are highlighted as if they are internal links. This is only a problem in edit mode, not preview.

Steps to reproduce

Type something in single square brackets in edit mode: [hello world]. See?

Expected result

Single square brackets should look like plain text. The internal link style should only be activated when you type double square brackets.

Actual result

Internal link style. This happens regardless of custom css or not.

Environment

  • Operating system: Mac OS 10.15.6
  • Obsidian version: v0.8.4

Additional information

2 Likes

single braket pairs have other uses in markdown, so it is good as it is.

Escape with backslash.

L\[S,C \]

gives L[S,C]

1 Like

…I managed to fix this with the following custom css:

.cm-s-obsidian span.cm-link {
	color: inherit;
}
1 Like

Thanks for this. A slight improvement that I THINK is working will enable the snippet to remove the color from [random square-bracketed text] while still retaining the correct color for correctly formatted links, eg [test-link](https://forum.obsidian.md/)

.cm-s-obsidian span.cm-hmd-barelink {
	color: inherit;
}
4 Likes

What other uses to single bracket pairs have in Markdown? And if they have such uses, why do they show up normally in reading mode, but not Live Preview?

Now, single bracket pairs when followed by parentheses do something, but we’re not talking about that situation.

1 Like