JohannesKaufmann/html-to-markdown

Potential issue in the Table plugin with the isFirstTbody logic

bramstes opened this issue · 1 comments

Hello in the table.go plugin there's an issue with the firstSibling logic in the isFirstTbody function.

func isFirstTbody(s *goquery.Selection) bool {
firstSibling := s.Siblings().Eq(0) // TODO: previousSibling
if s.Is("tbody") && firstSibling.Length() == 0 {
return true
}
return false
}

I'm retrieving tables from confluence html format tbody-tr-th's. Somehow the firstSibling.Length() is not 0 haven't figured it out completely but when I comment it out it seems to do what it's supposed to do although might introduce a new bug :).

github.com/JohannesKaufmann/html-to-markdown v1.3.6
github.com/PuerkitoBio/goquery v1.8.0

@bramstes can you please add the HTML snippet that causes the problems?

And you are using commonmark + the table plugin? Any other plugin?