Grinnz / perldoc-browser

Perldoc Browser
https://perldoc.perl.org
Artistic License 2.0
55 stars 21 forks source link

Table of contents links no longer work #54

Closed happy5214 closed 1 year ago

happy5214 commented 1 year ago

The a HTML elements in the code blocks are being removed by at least Firefox 108.0, apparently for security reasons (the browser console complains about them being unescaped). This causes all of the links in the main table of contents to be stripped and turned into plain code text, rendering the ToC mostly useless.

WRSomsky commented 1 year ago

The same happens w/ a chrome browser on my mobile phone: no links. Chrome 109.0 Android 13 Pixel 7

peterdd commented 1 year ago

I can confirm this with Firefox 109,

Links are rendered when javascript.enabled is off in the about:config

So can be seen as highlight.js-issue? (https://github.com/highlightjs/highlight.js/wiki/security) perldoc-highlightjs

haarg commented 1 year ago

This is caused by a combination of updating highlight.js and 4c47d7cda22fa8af9a580fb491e66cf4c1f356fb. I'm not really clear what the purpose of using plaintext rather than nohighlight is.

Grinnz commented 1 year ago

That's annoying. Regardless it's only an issue for these customized code blocks on that page. Would be more of an issue if we wanted to insert links into code snippets like the old perldoc site did.

Grinnz commented 1 year ago

Thanks for the example, I didn't know what was meant by "table of contents" since that refers to the list at the top of the page.

Grinnz commented 1 year ago

I need to re-render each perl with this change but it should be fixed by tomorrow. Thanks for the report!