yuin / goldmark

:trophy: A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.
MIT License
3.68k stars 255 forks source link

Regression: comments inside lists #287

Closed kcarnold closed 2 years ago

kcarnold commented 2 years ago

Crashing testcase:

- This is a list item <!-- Comment: an innocent-looking comment -->

I just submitted https://github.com/gohugoio/hugo/issues/9658 but I suspect that this is related to #285.

jmooring commented 2 years ago

Regression 1.4.8 -> 1.4.9

test.go ```go package main import ( "bytes" "fmt" "github.com/yuin/goldmark" ) func main() { md := goldmark.New() input := `- a ` var buf bytes.Buffer if err := md.Convert([]byte(input), &buf); err != nil { panic(err) } fmt.Println(buf.String()) } ```

Other failing examples:

a <!-- b -->
> a <!-- b -->
[a](b) <!-- c -->
![a](b) <!-- c -->
## a <!-- b -->
polarweasel commented 2 years ago

Another failing example (anywhere in a table will do it):

| a <!-- b -->