Fix and improve highlighting with highlight.js#435
Merged
Conversation
EParzefall
approved these changes
Mar 1, 2022
xoxys
reviewed
Mar 1, 2022
| * See: https://github.com/highlightjs/highlight.js/wiki/security | ||
| * A hljs command has been added in partials/footer-scripts.hbs | ||
| * hljs.configure({ ignoreUnescapedHTML: true }) | ||
| * This is not a security issue for us as we have a static site |
Contributor
There was a problem hiding this comment.
That is simply not true. Someone could sneak in evil code in a docs PR, and it can get merged by someone who is not aware of this potential issue. Why not simply escape the HTML within code blocks as recommended? There is no real reason to disable security mechanisms.
Collaborator
Author
There was a problem hiding this comment.
ok, thanks for the insight. I will open a new issue.
This was referenced Mar 2, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References: owncloud/docs-server#94 ([QA] Manual copy / paste misses redirects)
References: owncloud/docs#4707 (Add info for the correct use of the source langauge)
Description:
console(shell.js) andbash(bash.js). Whilebashhighlights any recognized bash keyword word from the beginning and let this also be selectable via CSS in the browser,consolerequires mandatory a bash promt at the beginning to highlight bash keywords correctly - but additionally disables the bash prompt as selectable component in the browserphpen/dismodorwgetect, see: Adding Keywords to a Language at Startup. Some keywords are added in advance like thea2xxxcommands and will automatically be highlighted when the next release of highlight.js gets published, see: enh(bash)$pattern: allow numbers after the first character highlightjs/highlight.js#3494occkeyword has been added to the above listNOTE:
Examples:
(The examples below already reflect a correct language used)
@jnweiger fyi