ndy2 / mkdocs-obsidian-support-plugin

A MkDocs plugin that supports obsidian to mkdocs convert
https://ndy2.github.io/mkdocs-obsidian-support-plugin/
MIT License
15 stars 5 forks source link

Using tags conversion feature breaks text styling #47

Closed Branskugel closed 1 month ago

Branskugel commented 1 month ago

Tags conversion feature replaces hash symbol at the beginning of any color hex code making it impossible to use colors for e.g. highlighting text. Using escape symbol does not help, because the hex code stops working

ndy2 commented 1 month ago

Hi. @Branskugel.

Thank you for open the issue. Can you tell me what do you mean by highlighting text with hex code in mkdocs-material?

I understand that you do not want to convert something like '#ff5733' to '#ff5733{: .hash}'

Branskugel commented 1 month ago

Hi, @ndy2 ! Sure, I mean doing stuff like this

example <span style="background:#ff4d4f">highlighted</span> text

Branskugel commented 1 month ago

Had to resort to manually convert hex colors to hsl() or rgb(), but it's a bit tedious, obviously. Plus they seem to not work in conjunction with <font> tag for coloring text itself, but that's on the obsidian (or perhaps my fault) side

ndy2 commented 1 month ago

That is a good request! I will fix it within this weekend.

ndy2 commented 1 month ago

v1.4.1 released with an improvement - #48/ Exclude HTML from being converted in Markdown

Above example is tested in my local environment. image

Instead of targeting tag conversion with span tag, I think plugin needs to Exclude all HTML from being converted. But the implementation has a little limitation. see #49