Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit82d0ca1

Browse files
authored
Command Line: Added span around command and output (#3312)
1 parent2cc4660 commit82d0ca1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,14 @@
130130
// Reinsert the output lines into the highlighted code. -- cwells
131131
varcodeLines=env.highlightedCode.split('\n');
132132
varoutputLines=commandLine.outputLines||[];
133-
for(vari=0,l=outputLines.length;i<l;i++){
133+
for(vari=0,l=codeLines.length;i<l;i++){
134+
// Add spans to allow distinction of input/output text for styling
134135
if(outputLines.hasOwnProperty(i)){
135-
codeLines[i]=outputLines[i];
136+
codeLines[i]='<span class="token output">'
137+
+outputLines[i]+'</span>';
138+
}else{
139+
codeLines[i]='<span class="token command">'
140+
+codeLines[i]+'</span>';
136141
}
137142
}
138143
env.highlightedCode=codeLines.join('\n');

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp