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

html-conduit: capitalized <BR> is not auto-closed #167

Closed
EarlGray opened this issue Aug 15, 2021 · 1 comment
Closed

html-conduit: capitalized <BR> is not auto-closed #167

EarlGray opened this issue Aug 15, 2021 · 1 comment

Comments

@EarlGray
Copy link

EarlGray commented Aug 15, 2021

I am using html-conduit-1.3.2.1.

The observed behavior

I observe <br> tags being auto-closed properly, i.e. EventEndElement is issued automatically after EventBeginElement, but capital-case <BR> is not auto-closed.

A minimal reproducible example (an excerpt from https://lwn.net):

<body>
  Copyright © 2021, Eklektix, Inc.<BR>
  Linux  is a registered trademark of Linus Torvalds<br>
</body>

The produced sequence of events (nameNamespace=Nothing, namePrefix=Nothing redacted for clarity):

EventBeginElement (Name {nameLocalName = "body", ..}) []
  EventContent (ContentText "\n  Copyright \169 2021, Eklektix, Inc.")
  EventBeginElement (Name {nameLocalName = "BR", ..}) []
    EventContent (ContentText "\n  Linux  is a registered trademark of Linus Torvalds")
    EventBeginElement (Name {nameLocalName = "br", ..}) []
    EventEndElement (Name {nameLocalName = "br", ..})
    EventContent (ContentText "\n")
  EventEndElement (Name {nameLocalName = "BR", ..})
EventEndElement (Name {nameLocalName = "body", ..})

The desired behavior

EventEndElement should be issued immediately for <BR> and other upper-case auto-closing tags:

EventBeginElement (Name {nameLocalName = "BR", ..})
EventEndElement (Name {nameLocalName = "BR", ..})
@snoyberg
Copy link
Owner

Good catch, thanks! This should be fixed in html-conduit-1.3.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants