Open eht16 opened 1 year ago
It wouldn't be the first time that I see this, for example the Scala HTML/XML parser implementation used by Spark in Azure has this behavior. Talked to Microsoft about it and it is intended behavior.
Parsing HTML is hard since pretty much almost any string is 'valid' HTML, anyway, without going too deep into the pyquery/lxml implementation I wouldn't be surprised if it was intended.
With some HTML like:
only the text of the
a
tag is matched but not the text beyong (the HTML snippet corresponds to the returnedcontent
field in the Mastodon API, https://docs.joinmastodon.org/methods/statuses/#get).I'm not sure if this is desired behavior or a bug. For comparison I tried BeautifulSoup and html2text and both consider the additional text and return it.
P.S.: great to see this package is maintained again! :heart: