Extra asterisk, underscore, etc., from HTML when paste

Sometimes when I copy and paste texts from a website (e.g: https://www.geeksforgeeks.org/), a bold heading which is inside in html, will be pasted into Obsidian with the following format:

## ****heading name****

Is there documentation on how that conversion happens and why are we getting 4 asterisk instead of 2? The same can happen with underscore, and even more weird for math or latex formats

  • Trying to see if this is a bug ?
  • or expected behavior that can be fixed with some kind of clipboard cleaner?
  • Or can we only fix it with custom Linter rules?

Thank you!

Can’t you just use Ctrl + Shift + V to paste without formatting?

I would still like to keep the format so I don’t have to reapply it, I assume stripping the format would strip the heading and bold all together?

Yeah, pasting as plain text will strip all formatting.


For what it’s worth, copying from Safari or Arc and then pasting into Typora results in the same.

CleanShot 2025-05-04 at 12.12.37

1 Like

The site uses both bold and strong on the same element, so down to the site?

<b><strong>Python Tutorial</strong></b>
3 Likes

Yeah, that’s double-bad markup in HTML.

  • The combination of <b> and <strong> doesn’t make sense.
  • And I loathe seeing <b> or <strong> in headings. A simple <h2> is all the markup needed.

Obsidian translates the bad HTML correctly, even if the result is bad Markdown.

3 Likes

Yes that’s good to know.
I’m that case I’ll keep using this custom Linter rule I’ve setup with ChatGPT’s help to correct such incorrect formatting.
Thnx all!

2 Likes