danneu / html-parser

a lenient html5 parser written in Elm
MIT License
5 stars 0 forks source link

Can not parse html that start with an empty line: err: "[{ col = 1, problem = Expecting \"<!\", row = 1 }]" #7

Open pogiaron opened 1 year ago

pogiaron commented 1 year ago

I am trying to parse this HTML but I can not: (note first line is empty)

<!DOCTYPE html>

If I remove the first empty line the parsing works. Is it intended?

pogiaron commented 1 year ago

False negative, It seems the problem is not with the package

pogiaron commented 1 year ago

I found the problem. It seems when the first line is empty I get an error. I think the parser should handle that case. What do you think? I checked the html spec it seems it should not cause problem