commonmark / cmark

CommonMark parsing and rendering library and program in C
Other
1.63k stars 544 forks source link

`parse_list_marker` Does Not Correctly Check for CRLF. #550

Open n0s4 opened 3 months ago

n0s4 commented 3 months ago

I'm just reading through the code, and I may be wrong but...

      /* blocks.c > parse_list_marker */

      // require non-blank content after list marker:
      while (S_is_space_or_tab(peek_at(input, i))) {
        i++;
      }
      if (peek_at(input, i) == '\n') {
        return 0;
      }

Seeing as the rest of the parser tries to be compatible with CRLF, I would expect S_is_line_end_char to be used instead of just comparing to a newline char. Am I missing why this is not necessary?

Edit: In the following branch for numbered markers, there is the same logic but S_is_line_end_char is used instead, so I'm pretty sure now that this is an oversight.