File tree Expand file tree Collapse file tree 4 files changed +26
-2
lines changed Expand file tree Collapse file tree 4 files changed +26
-2
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+ EXTRACT ME 1 input.md /^# EXTRACT ME 1$/;" c
Original file line number Diff line number Diff line change 1+ <!--
2+ # SKIP ME 1
3+ -->
4+
5+ <!-- # SKIP ME 2 -->
6+
7+ # EXTRACT ME 1
Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ static void findMarkdownTags (void)
193193 long startSourceLineNumber = 0 ;
194194 long startLineNumber = 0 ;
195195 bool inPreambule = false;
196+ bool inComment = false;
196197
197198 nestingLevels = nestingLevelsNewFull (0 , fillEndField );
198199
@@ -246,9 +247,23 @@ static void findMarkdownTags (void)
246247 lineProcessed = true;
247248 }
248249 }
250+ /* XML comment start */
251+ else if (lineLen >= pos + 4 && line [pos ] == '<' && line [pos + 1 ] == '!' &&
252+ line [pos + 2 ] == '-' && line [pos + 3 ] == '-' )
253+ {
254+ if (strstr ((const char * )(line + pos + 4 ), "-->" ) == NULL )
255+ inComment = true;
256+ lineProcessed = true;
257+ }
258+ /* XML comment end */
259+ else if (inComment && strstr ((const char * )(line + pos ), "-->" ))
260+ {
261+ inComment = false;
262+ lineProcessed = true;
263+ }
249264
250- /* code block */
251- if (inCodeChar )
265+ /* code block or comment */
266+ if (inCodeChar || inComment )
252267 lineProcessed = true;
253268
254269 /* code block using indent */
You can’t perform that action at this time.
0 commit comments