d2 icon indicating copy to clipboard operation
d2 copied to clipboard

about handling '&' in markdown

Open bo-ku-ra opened this issue 1 year ago • 1 comments

API error https://play.d2lang.com/?l=&script=BMCxDgIhDADQna9obnC8xhsJ4LcQWsHEUgWSLnz8PWFRD1vIAYQMbfA7Hm2t3_SIZnZW1frls6jg5DxKe_0jXY_OZp9OavF5JLoC5uS2uwMAAP__&

url is difficult to handle. https://play.d2lang.com/?l=&script=BMAxDsMgDADAnVdYGTrGasY0pG-xYhcq1ZgCkhcen1NR22EqB4CDIDf5xCWPUfuO6O5rMks_WS9T7ELtyu9_5O1BWl9F3L-FzeNzOXk7kM4wwx0AAP__&

bo-ku-ra avatar Apr 10 '24 01:04 bo-ku-ra

Notes:

<a href="asdf&asdf">b</a> doesn't work because it's raw html which is rendered as-is without escapes (in order for the html to work), but the ampersand gets interpreted as an XML entity in SVG (like &lsqou;).

https://github.com/yuin/goldmark is so extensible i'm sure there's a way to add a parsing extension that replaces & with &amp; or make urls safe when rendering unsafe html. Not high priority to do right now

alixander avatar Apr 16 '24 16:04 alixander