wjdp / htmltest

:white_check_mark: Test generated HTML for problems
MIT License
325 stars 54 forks source link

Feature Request: emit line numbers #88

Open osterman opened 6 years ago

osterman commented 6 years ago

First, this utility is awesome! Thanks for investing all the time to make it so powerful.

It would be helpful if the utility output line numbers within the file.

Thanks!

wjdp commented 6 years ago

Hi @osterman, thank you for your kind words!

The lack of line numbers, sadly, is not a careless omission. The library (golang's x/net/html) we are currently using for parsing HTML does not give us a clear path back from a node to its origin.

This issue will remain open, this is a feature that is missing, however it will require a direction and likely a large refactor for it to come about.

Ref #22

osterman commented 6 years ago

Thanks @wjdp ! Makes sense.

pgorod commented 6 years ago

I really miss this feature...!

Would this code help? https://stackoverflow.com/a/34960550/1189711

I don't know enough of Go (yet) to handle this myself...