Italics break correct rendering of links with underline(s) in the URL

I’m seeing issues with links that contain underscores - such as http://en.wikipedia.org/wiki/Copula_(linguistics) - when the link text is italicized.

Here is a sample Markdown:

[copula](http://en.wikipedia.org/wiki/Copula_(linguistics)) 
_[copula](http://en.wikipedia.org/wiki/Copula_(linguistics))_  
*[copula](http://en.wikipedia.org/wiki/Copula_(linguistics))*

| [copula](http://en.wikipedia.org/wiki/Copula_(linguistics))   |     |
| ------------------------------------------------------------- | --- |
| _[copula](http://en.wikipedia.org/wiki/Copula_(linguistics))_ |     |
| *[copula](http://en.wikipedia.org/wiki/Copula_(linguistics))* |     |

How it appears in editing view:

How it appears in reading view:

Escaping the underline as %5f in the URL solves the issue, but I have many such links imported from Evernote. Seems like an edge case, possibly a bug in the Markdown parser’s regex or pattern matching that might be relatively easy to fix.

Tested in the sandbox vault.

SYSTEM INFO:
Obsidian version: v1.8.10
Installer version: v1.7.4
Operating system: Windows 11 Home 10.0.26100
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 1
Restricted mode: off
Plugins installed: 1
Plugins enabled: 1
1: Importer v1.6.5

I can reproduce it although removing parentheses doesn’t produce the issue.

[copula](http://en.wikipedia.org/wiki/Copula_(linguistics)) 
_[copula](http://en.wikipedia.org/wiki/Copula_(linguistics))_  
*[copula](http://en.wikipedia.org/wiki/Copula_(linguistics))*

| [copula](http://en.wikipedia.org/wiki/Copula_(linguistics))   |     |
| ------------------------------------------------------------- | --- |
| _[copula](http://en.wikipedia.org/wiki/Copula_linguistics)_ |     |
| *[copula](http://en.wikipedia.org/wiki/Copula_(linguistics))* |     |

Hello.

Could you use …

[_copula_](http://en.wikipedia.org/wiki/Copula_(linguistics)) 
*[copula](<http://en.wikipedia.org/wiki/Copula_(linguistics)>)*
1 Like

You are absolutely right. At first, when I found this issue, I even thought that it was caused by the parentheses, but replacing them with, e.g., square (“[”) or curly (“{”) brackets, we also have the same result. So it is actually an issue caused by a few factors.

Ah, you mean formatting only the label of the URL?

[_copula_](http://en.wikipedia.org/wiki/Copula_(linguistics))
[*copula*](http://en.wikipedia.org/wiki/Copula_(linguistics))

It works! :grinning_face_with_smiling_eyes: I should have thought of that! :sweat_smile:
Thanks! :+1:

1 Like

Or escaping the URL in angled brackets should also work:

1. [_copula_](http://en.wikipedia.org/wiki/Copula_(linguistics)) 
2. [*copula*](http://en.wikipedia.org/wiki/Copula_(linguistics))
3. *[copula](<http://en.wikipedia.org/wiki/Copula_(linguistics)>)*

1 Like