Skip to content

Commit e002e78

Browse files
authored
Command Line: Escape markup in command line output (#3341)
1 parent 13b56a9 commit e002e78

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

plugins/command-line/prism-command-line.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@
143143
for (var i = 0, l = codeLines.length; i < l; i++) {
144144
// Add spans to allow distinction of input/output text for styling
145145
if (outputLines.hasOwnProperty(i)) {
146+
// outputLines were removed from codeLines so missed out on escaping
147+
// of markup so do it here.
146148
codeLines[i] = '<span class="token output">'
147-
+ outputLines[i] + '</span>';
149+
+ Prism.util.encode(outputLines[i]) + '</span>';
148150
} else {
149151
codeLines[i] = '<span class="token command">'
150152
+ codeLines[i] + '</span>';

plugins/command-line/prism-command-line.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)