File tree 3 files changed +6
-1
lines changed
3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
const chalk = require ( 'chalk' )
2
2
const prism = require ( 'prismjs' )
3
3
const loadLanguages = require ( 'prismjs/components/index' )
4
+ const escapeHtml = require ( 'escape-html' )
4
5
5
6
// required to make embedded highlighting work...
6
7
loadLanguages ( [ 'markup' , 'css' , 'javascript' ] )
7
8
8
9
function wrap ( code , lang ) {
10
+ if ( lang === 'text' ) {
11
+ code = escapeHtml ( code )
12
+ }
9
13
return `<pre v-pre class="language-${ lang } "><code>${ code } </code></pre>`
10
14
}
11
15
Original file line number Diff line number Diff line change 51
51
"copy-webpack-plugin" : " ^4.5.1" ,
52
52
"css-loader" : " ^0.28.11" ,
53
53
"es6-promise" : " ^4.2.4" ,
54
+ "escape-html" : " ^1.0.3" ,
54
55
"file-loader" : " ^1.1.11" ,
55
56
"globby" : " ^8.0.1" ,
56
57
"html-webpack-plugin" : " ^3.2.0" ,
Original file line number Diff line number Diff line change @@ -1578,7 +1578,7 @@ es6-promise@^4.2.4:
1578
1578
version "4.2.4"
1579
1579
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
1580
1580
1581
- escape-html@~1.0.1 :
1581
+ escape-html@^1.0.3, escape-html@ ~1.0.1 :
1582
1582
version "1.0.3"
1583
1583
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
1584
1584
You can’t perform that action at this time.
0 commit comments