Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape the HTML within code blocks #437

Open
mmattel opened this issue Mar 2, 2022 · 2 comments
Open

Escape the HTML within code blocks #437

mmattel opened this issue Mar 2, 2022 · 2 comments

Comments

@mmattel
Copy link
Collaborator

mmattel commented Mar 2, 2022

Referencing: Fix and improve highlighting with highlight.js

highlight.js reports in the browser console about unescaped HTML. The messaging is stopped via the referenced PR but the problem is not solved. We have to find a proper way to escape HTML for source blocks.

Note that the security issue is present for a long time but nobody took care. The messaging fix is just a cosmetic thing.

@xoxys fyi

@mmattel
Copy link
Collaborator Author

mmattel commented Mar 3, 2022

We keep this issue open to have a reminder to regulary check if a antora fix available. For details see the referenced PR

@mmattel
Copy link
Collaborator Author

mmattel commented Mar 7, 2022

Documenting a response in the Antora channel (zulip) about escaping html source blocks.

Guessing that the response comes from Antora 3 and not 2.3
Means that Antora 3 may behave correctly versus v2.3 in terms of escaping.
Finally we know after the upgrade to Antora 3.

Response

Short
<your-command> --> &lt;your-command&gt;

Long
...If you put the following block in your AsciiDoc file:

[,docker]
----
system-docker-compose exec --user www-data owncloud occ <your-command>
----

It will produce the following HTML:

<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-docker hljs" data-lang="docker">system-docker-compose exec --user www-data owncloud occ &lt;your-command&gt;</code></pre>
</div>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant