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.

5 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.

2 Likes

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

Hi, I found a parsing error while $ sign containing internal links in same line.

The problem definitely still exists, and happens when an underscore is inside a file name, not just at the beginning, but seemingly only if there is a space in front of it.

![[myfile name is _here.csv]]

everything after the underscore is in italics

![[myfile name is_here.csv]]

this is fine

Here’s the iA Writer editor as a good parsing example:

1 Like

One of my note name is like: _meeting notes - Events
Starting with the underline just to keep it on top.
While linking it in text → following editor change style to italic :frowning:

Steps to reproduce

  1. create a note with an underline at the beginning
  2. create next note and put text + link to above + text

Expected result

[editor view only] No change in style.

Actual result

[editor view only] All after _link become italic :frowning:

Environment

  • Operating system: Windows
  • Obsidian version: 0.12.12
  • Pure no plugins.

This also occurs with filenames with [ and ] brackets in them. Obsidian will happily create files with brackets if you drag them into the workspace, and then will happily show incorrect styles when the files are referenced:

an example of this bug

3 Likes

Steps to reproduce

  1. Create a note with a filename ending in a backtick character. For instance,
Example `backtick`.md
  1. Create a link with an alias in a different note:
[[Example `backtick`|An Alias]]

Expected result

Link should be displayed as the alias (in the example above An Alias).

Actual result

Link appears as:

backtick`An Alias

In the Reading view it works fine, this only affects the new Live Preview mode.

Environment

  • Operating system: Mac OS Monterey
  • Debug info:

SYSTEM INFO:
Obsidian version: v0.13.14
Installer version: v0.12.19
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Safe mode: on

RECOMMENDATIONS:
none


Additional information

The filename:

Screenshot 2021-12-22 at 10.33.33

How it is rendered:

Screenshot 2021-12-22 at 10.33.28

will be fixed in 0.13.15

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.