oleeskild / digitalgarden

285 stars 157 forks source link

[BUG] Internal links to headers that contain code are broken #268

Open ProtoxiDe22 opened 4 months ago

ProtoxiDe22 commented 4 months ago

As per title, if creating an internal obsidian link to an headers that contains text enclosed in backticks, once published with digitalgarden, the link breaks.

suppose i have a file called programming.md , inside this file i have an heading such as this

## Using `String.format()`

in obsidian i can link to it like every other heading by just writing

[[programming#using `String.format()`|using `String.format()`]]

this link works fine in Obsidian, but doesn't work when publishing the site with digitalgarden. I quickly found out that the HTML IDs of headings with code inside, have their backticks removed and substituted with the word "code" such that the heading from above converts to:

<h3 id="using-code-string-format-code" tabindex="-1">using <code>String.format()</code></h3>

that's obviously done to avoid breaking the HTML, but i suppose that's what throws off the page builder when creating links and generates this bug