naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.1k stars 326 forks source link

CSS property setting syntax does not permit the use of a colon (:) in the assigned value. #3886

Open dbolack-ab opened 2 days ago

dbolack-ab commented 2 days ago

Renderer

v3

Browser

Chrome

Operating System

Windows

What happened?

In writing a how-to I discovered I was unable to assign a string value to a CSS property if it contained a : via the {{}} style setting syntax.

Code

{{footer,--chapterName:"'1:How-to'"}}

Generates

<span class="inline-block footer" style="--chapterName:;">“‘1:How-to’”</span>

Instead of

<span class="inline-block footer" style="--chapterName:‘1:How-to’;”></span>
dbolack-ab commented 2 days ago

The semi-colon is also superfluous.

5e-Cleric commented 2 days ago

Right, we need to encode as a CSS string: https://developer.mozilla.org/en-US/docs/Web/CSS/string

5e-Cleric commented 2 days ago

This also applies to html attributes.