File tree 2 files changed +5
-9
lines changed
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,13 @@ const md = require('markdown-it')({
36
36
highlight : function ( str , lang ) {
37
37
if ( lang && hljs . getLanguage ( lang ) ) {
38
38
try {
39
- return '<pre class="nohighlight"><code>' +
39
+ return '<pre class="nohighlight" tabindex="0" ><code>' +
40
40
hljs . highlight ( str , { language : lang } ) . value +
41
41
'</code></pre>' ;
42
42
} catch ( __ ) { }
43
43
}
44
44
45
- return '<pre class="highlight ' + lang + '"><code>' + md . utils . escapeHtml ( str ) + '</code></pre>' ;
45
+ return '<pre class="highlight ' + lang + '" tabindex="0" ><code>' + md . utils . escapeHtml ( str ) + '</code></pre>' ;
46
46
}
47
47
} ) ;
48
48
@@ -216,7 +216,6 @@ for (let l in lines) {
216
216
// recognize code blocks
217
217
if ( line . startsWith ( '```' ) ) {
218
218
inCodeBlock = ! inCodeBlock ;
219
- line += '\n' ; // fixes formatting of first line of syntax-highlighted blocks
220
219
}
221
220
222
221
if ( line . indexOf ( '<a name="' ) >= 0 ) {
Original file line number Diff line number Diff line change 7
7
< p > Text for first section</ p >
8
8
< section > < h2 > Heading 3</ h2 >
9
9
< p > Text for first subsection</ p >
10
- < pre class ="nohighlight "> < code >
11
- < span class ="hljs-punctuation "> {</ span >
10
+ < pre class ="nohighlight " tabindex ="0 "> < code > < span class ="hljs-punctuation "> {</ span >
12
11
< span class ="hljs-attr "> "foo"</ span > < span class ="hljs-punctuation "> :</ span > < span class ="hljs-literal "> < span class ="hljs-keyword "> true</ span > </ span >
13
12
< span class ="hljs-punctuation "> }</ span >
14
13
</ code > </ pre >
15
- < pre class ="nohighlight "> < code >
16
- text/plain
14
+ < pre class ="nohighlight " tabindex ="0 "> < code > text/plain
17
15
</ code > </ pre >
18
- < pre class ="highlight "> < code >
19
- no language
16
+ < pre class ="highlight " tabindex ="0 "> < code > no language
20
17
</ code > </ pre >
21
18
< table >
22
19
< thead >
You can’t perform that action at this time.
0 commit comments