File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,13 +36,13 @@ const md = require('markdown-it')({
3636 highlight : function ( str , lang ) {
3737 if ( lang && hljs . getLanguage ( lang ) ) {
3838 try {
39- return '<pre class="nohighlight"><code>' +
39+ return '<pre class="nohighlight" tabindex="0" ><code>' +
4040 hljs . highlight ( str , { language : lang } ) . value +
4141 '</code></pre>' ;
4242 } catch ( __ ) { }
4343 }
4444
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>' ;
4646 }
4747} ) ;
4848
@@ -216,7 +216,6 @@ for (let l in lines) {
216216 // recognize code blocks
217217 if ( line . startsWith ( '```' ) ) {
218218 inCodeBlock = ! inCodeBlock ;
219- line += '\n' ; // fixes formatting of first line of syntax-highlighted blocks
220219 }
221220
222221 if ( line . indexOf ( '<a name="' ) >= 0 ) {
Original file line number Diff line number Diff line change 77< p > Text for first section</ p >
88< section > < h2 > Heading 3</ h2 >
99< 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 >
1211 < span class ="hljs-attr "> "foo"</ span > < span class ="hljs-punctuation "> :</ span > < span class ="hljs-literal "> < span class ="hljs-keyword "> true</ span > </ span >
1312< span class ="hljs-punctuation "> }</ span >
1413</ code > </ pre >
15- < pre class ="nohighlight "> < code >
16- text/plain
14+ < pre class ="nohighlight " tabindex ="0 "> < code > text/plain
1715</ code > </ pre >
18- < pre class ="highlight "> < code >
19- no language
16+ < pre class ="highlight " tabindex ="0 "> < code > no language
2017</ code > </ pre >
2118< table >
2219< thead >
You can’t perform that action at this time.
0 commit comments