Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`xmltree.findAll` doesn't work as expected with `htmlparser` for non-lowercase names #8329

Closed
tim-st opened this issue Jul 15, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@tim-st
Copy link
Contributor

commented Jul 15, 2018

I tried the example from here on something like

<P class=MsoNormal 
style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; TEXT-AUTOSPACE: ; mso-pagination: none; mso-layout-grid-align: none"><SPAN 
lang=de 
style='FONT-SIZE: 12pt; FONT-FAMILY: "TimesNewRoman","serif"; mso-bidi-font-family: TimesNewRoman; mso-ansi-language: #0007'>1</SPAN><I><SPAN lang=de 
style='FONT-SIZE: 12pt; FONT-FAMILY: "TimesNewRoman,Italic","serif"; mso-bidi-font-family: "TimesNewRoman,Italic"; mso-ansi-language: #0007'>2<o:p></o:p></SPAN></I></P>

but html.findAll("P") doesn't work, instead only html.findAll("p") works, which is unexpected.

@GULPF

This comment has been minimized.

Copy link
Member

commented Jul 15, 2018

I don't think this is fixable, due to Nim using the same data structure for XML and HTML. Tags in XML are case sensitive afaik.

@tim-st tim-st changed the title `xmltree.findAll` doesn't handle non-lowercase names correctly `xmltree.findAll` doesn't work as expected with `htmlparser` for non-lowercase names Jul 16, 2018

@Araq

This comment has been minimized.

Copy link
Member

commented Jul 17, 2018

@GULPF at least findAll can grow an option to support this.

@GULPF

This comment has been minimized.

Copy link
Member

commented Aug 28, 2018

IMO sooner or later we will need to introduce a seperate type for HTML, even if it's just type HtmlNode = distinct XmlNode.

narimiran added a commit to narimiran/Nim that referenced this issue May 22, 2019

@Araq Araq closed this in 44cc5f6 May 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.