File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import {
2525import rehypeParse from 'rehype-parse' ;
2626import { visit } from 'unist-util-visit' ;
2727import rangeParser from 'parse-numeric-range' ;
28- import { reverseString } from './chars/utils' ;
2928import { unified , type Transformer } from 'unified' ;
3029import { charsHighlighter } from './chars/charsHighlighter' ;
3130import { toString as hastToString } from 'hast-util-to-string' ;
@@ -435,14 +434,16 @@ export function rehypePrettyCode(
435434 // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: <explanation>
436435 visit ( codeTree , 'element' , ( element ) => {
437436 if ( element . tagName === 'code' ) {
438- const showLineNumbers = / (?: ^ | \s ) s h o w L i n e N u m b e r s (?: \s | $ ) / . test ( meta ) ;
437+ const showLineNumbers = / (?: ^ | \s ) s h o w L i n e N u m b e r s (?: \s | $ ) / . test (
438+ meta ,
439+ ) ;
439440 if ( showLineNumbers ) {
440441 if ( element . properties ) {
441442 element . properties [ 'data-line-numbers' ] = '' ;
442443 }
443444
444445 const lineNumbersStartAtMatch = meta . match (
445- / s h o w L i n e N u m b e r s = ( \d + ) /
446+ / s h o w L i n e N u m b e r s = ( \d + ) / ,
446447 ) ;
447448 const startNumberString = lineNumbersStartAtMatch ?. [ 1 ] ;
448449 if ( startNumberString ) {
You can’t perform that action at this time.
0 commit comments