File tree Expand file tree Collapse file tree 6 files changed +20
-10
lines changed Expand file tree Collapse file tree 6 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 1+ --sort=no
Original file line number Diff line number Diff line change 1+ A input.md /^# A$/;" c
Original file line number Diff line number Diff line change 1+ ` O `
2+ # A
3+
Original file line number Diff line number Diff line change @@ -28,10 +28,10 @@ F input.md /^F$/;" s chapter:C end:106 sectionMarker:-
2828G input.md /^ G$/;" s chapter:C end:109 sectionMarker:-
2929H input.md /^ H$/;" s chapter:C end:112 sectionMarker:-
3030I input.md /^ I$/;" s chapter:C end:128 sectionMarker:-
31- C\\# input.md /^# C\\#$/;" c end:141 sectionMarker:#
31+ C\\# input.md /^# C\\#$/;" c end:143 sectionMarker:#
3232J input.md /^J$/;" s chapter:C\\# end:133 sectionMarker:-
3333K input.md /^K$/;" s chapter:C\\# end:136 sectionMarker:-
34- L input.md /^L$/;" s chapter:C\\# end:141 sectionMarker:-
34+ L input.md /^L$/;" s chapter:C\\# end:143 sectionMarker:-
3535x input.md /^function x$/;" f
3636y input.md /^function y$/;" f
3737z input.md /^z()$/;" f
Original file line number Diff line number Diff line change 139139
140140ignored
141141 -
142+
143+ ``` foo ```
Original file line number Diff line number Diff line change @@ -213,22 +213,25 @@ static void findMarkdownTags(void)
213213 if (inPreambule )
214214 continue ;
215215
216- for (int i = 0 ; i < 2 && !indented ; i ++ )
216+ /* fenced code block */
217+ if (line [pos ] == '`' || line [pos ] == '~' )
217218 {
218- char code_chars [] = { '`' , '~' };
219- char c = code_chars [i % 2 ];
220- char other_c = code_chars [(i + 1 ) % 2 ];
219+ char c = line [pos ];
220+ char other_c = c == '`' ? '~' : '`' ;
221+ int n_same ;
222+ for (n_same = 1 ; line [n_same ] == line [pos ]; ++ n_same );
221223
222- if (in_code_char != other_c && line_len >= 3 &&
223- line [pos ] == c && line [pos + 1 ] == c && line [pos + 2 ] == c )
224+ if (in_code_char != other_c && n_same >= 3 )
224225 {
225226 in_code_char = in_code_char ? 0 : c ;
226- if (in_code_char )
227+ if (in_code_char == c && strstr ((const char * )(line + pos + n_same ), "```" ) != NULL )
228+ in_code_char = 0 ;
229+ else if (in_code_char )
227230 {
228231 startSourceLineNumber = getSourceLineNumber ();
229232 startLineNumber = getInputLineNumber ();
230233 vStringClear (codeLang );
231- vStringCatS (codeLang , (const char * )(line + pos + 3 ));
234+ vStringCatS (codeLang , (const char * )(line + pos + n_same ));
232235 vStringStripLeading (codeLang );
233236 vStringStripTrailing (codeLang );
234237 }
You can’t perform that action at this time.
0 commit comments