File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -187,10 +187,6 @@ export default class CodeBlock extends ParagraphBase {
187187 } else {
188188 // 默认使用prism渲染代码块
189189 if ( ! lang || ! Prism . languages [ lang ] ) lang = 'javascript' ; // 如果没有写语言,默认用js样式渲染
190- if ( Prism . highlight ( '\\' , Prism . languages [ lang ] , lang ) . indexOf ( 'span' ) > - 1 ) {
191- // 斜杠\被转化为标签时将\\还原为\
192- cacheCode = cacheCode . replace ( / \\ \\ / g, '\\' ) ;
193- }
194190 cacheCode = Prism . highlight ( cacheCode , Prism . languages [ lang ] , lang ) ;
195191 cacheCode = this . renderLineNumber ( cacheCode ) ;
196192 }
@@ -242,8 +238,8 @@ export default class CodeBlock extends ParagraphBase {
242238 }
243239 // $code = this.$replaceSpecialChar($code);
244240 $code = $code . replace ( / ~ X / g, '\\`' ) ;
245- $code = $code . replace ( / \\ / g, '\\\\' ) ;
246241 cacheCode = this . renderCodeBlock ( $code , $lang , sign , lines ) ;
242+ cacheCode = cacheCode . replace ( / \\ / g, '\\\\' ) ;
247243 cacheCode = this . $codeCache ( sign , cacheCode ) ;
248244 return this . getCacheWithSpace ( this . pushCache ( cacheCode , sign , lines ) , match ) ;
249245 } ) ;
You can’t perform that action at this time.
0 commit comments