pietroppeter / nimibook

A port of mdbook to nim(ib)
https://pietroppeter.github.io/nimibook/
MIT License
76 stars 7 forks source link

The `<code>` tag, when inline code with backticks, does not receive a background #89

Open rockcavera opened 7 months ago

rockcavera commented 7 months ago

All inline code with backticks is not being rendered with a background, which makes it difficult to distinguish an inline code from the rest of the text.

This problem occurs in all nimibook themes.

pietroppeter commented 7 months ago

Yes, it is a problem of nimib. Nim code in nbCode or similar blocks is statically highlighted and receive the different background from highlight.js default theme. The code in markdown is not statically highlighted and highlight.js theme is not applied. I think there should be an issue in nimib related to this (currently on mobile and hard to find it).

rockcavera commented 7 months ago

From the research I did, adding class="hljs", in the <code> tags, of the inline code, would solve the problem.

However, in a quick look at the nimibook code, I saw that the rendering is all delegated to nimib. I haven't seen the nimib code yet, but I believe that the change cannot be made there, as it will disrupt the nimib library.

pietroppeter commented 7 months ago

Yes adding that class would trigger the highlighting through css. The change should be indeed made in nimib. Nimibook is not responsible for collecting multiple nimib documents in a single static site with a predefined theme (from mdbook)