Markdown formatting should be ignored within wikilinks and tags

Steps to reproduce

Copy this to your note:

  • [ ] Check your [[__DOIT]] page for reminders

Expected result

The part “page for reminders” shouldn’t be bolded in edit mode.

Actual result

The part “page for reminders” is bolded in edit mode.

Environment

  • Operating system: Ubuntu 20.04
  • Obsidian version: 0.8.0

Additional information

It’s a very small bug, but a bug nonetheless.

2 Likes

Try to insert space between $ and inside text, such as

[[some$ 10thing]] against [[another $5thing]]

late reply, sorry. Unfortunately I need this without spacing. My example was poorly worded. These items with an embedded dollar sign are objects in a programming language so the lack of spaces and location of the dollar sign are meaningful. Not sure of a solution. Been playing with custom CSS but not good enough to get too far.

Is Mathjax the tool that is causing this problem? I wonder if someday we can control the in-line delimiter character chosen since $ can be used so actively for other things. Personally I would choose some emoji character :sunglasses:

Steps to reproduce

Paste the following text in the editor:

Here's my [[_file]] and this text is now in italics.

Expected result

The text in between square brackets should be isolated in the markdown parser so the following text doesn’t get any side affects.

Environment

  • Operating system: MacOS 10.14.6
  • Obsidian version: v0.8.0
2 Likes

Just figured out it’s not about linked files but overall about markdown parsing.

If text contains underscore, the following text will become italicized. Example:

Here's my _underscore and this text is now italicized.

This is correct Markdown behavior, I guess, at least according to the spec. However the spec says the text should be wrapped with underscores, so I presume it’s up to the developers how to treat a single asterisk or an underscore character attached to a word.

This one indeed seems to be a bug. Underscore is a valid filename character, so when it’s within wikilinks or usual links, there’s no point in italicising the text that follows.

The behavior by Obsidian regarding wrapping is inconsistent between the editor and the preview. A single asterisk results in italics in the editor, but plain text in the preview.

IMO the behavior of the preview (right image below) is correct - not formatting unless the text is properly wrapped - and this behavior should be implemented in the editor. An alternative would be introducing escape characters for those cases (adding an \ to a link throw an error in Obsidian, e.g. [[\_this doesn't work in Obsidian]])


Editor is on the left, Preview on the right.

1 Like

I came here to report this issue regarding file names starting with an underscore. Many people (including myself) have the convention of adding an underscore at the start of a filename if it needs to be at the top of the list of files. Right now it’s mildly annoying to link to them because when you type the first underscore it automatically creates a second one after the cursor, even when inside the brackets for a link. This on top of the annoying italics it generates…

But like I said, it’s a minor annoyance.

2 Likes

Tags are also affected by this issue:

If you include a tag such as “#_temp” in a note, all text following the underscore erroneously gets italicized (in Edit mode).

It might still be desired to use markdown formatting in alternative text after pipe character in wikilink.
I use markdown-style links and I think, markdown formatting should be ignored in url part of the link. Unfortunately many existing parsers do not respect this. It is headache when I have to reference some stupid folder/file names as reported and still completely unresolved in:

Related: Support underscores "_" in block-id

Proposed solution:

Develop syntax to reference links from YAML header where they can be easily stored as “block literals” which conveniently do not require encoding in YAML. markdown
Reference-style link syntax could be used for this. If markdown reference definition is not found, then check if anchor exists in YAML front-matter.

---
related: 
  - &YAMLAnchor1 file1.md
  - &Anchor2 file2.md
  - file3.md
---
Possible options to consider: 
- [text][YAMLAnchor1] %% reference-style + YAML anchors %%
- [[{{Anchor2}}|text]] or [text]({{Anchor2}}) %% some syntax for referencing variables %%
- ...

Hello!,

this is my first post here, so let me just say: obsidian is plain awesome, thank you very much :heart:

Steps to reproduce

There are files in my vault and their name starts or contains character ‘$’, ie. $index
I want to link them like:

[[$file1]]
[[$file]] [[$file]]
[[$file]] [[$file]][[$file]]
[[$file]] [[$file]][[$file]] [[$file]] [[$file]] [[$file]]
[[$file]] [[$file]][[$file]] [[$file]][[$file]] [[$file]] [[$file]]

but i see distorted view in editor

Expected result

Actual result

Imgur

Environment

  • Operating system: Windows 10
  • Obsidian version: 0.10.11

Additional information

1 Like