Skip to content

Commit

Permalink
Command Line: Escape markup in command line output (#3341)
Browse files Browse the repository at this point in the history
  • Loading branch information
at055612 committed Feb 16, 2022
1 parent 13b56a9 commit e002e78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plugins/command-line/prism-command-line.js
Expand Up @@ -143,8 +143,10 @@
for (var i = 0, l = codeLines.length; i < l; i++) {
// Add spans to allow distinction of input/output text for styling
if (outputLines.hasOwnProperty(i)) {
// outputLines were removed from codeLines so missed out on escaping
// of markup so do it here.
codeLines[i] = '<span class="token output">'
+ outputLines[i] + '</span>';
+ Prism.util.encode(outputLines[i]) + '</span>';
} else {
codeLines[i] = '<span class="token command">'
+ codeLines[i] + '</span>';
Expand Down
2 changes: 1 addition & 1 deletion plugins/command-line/prism-command-line.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e002e78

Please sign in to comment.