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

Incorrect parsing of inline tags when capitalized #57

Closed
ForbesLindesay opened this issue Jun 23, 2013 · 4 comments
Closed

Incorrect parsing of inline tags when capitalized #57

ForbesLindesay opened this issue Jun 23, 2013 · 4 comments
Labels

Comments

@ForbesLindesay
Copy link
Collaborator

<p>foo</p>
<hr>
<p>bar</p>

correctly produces:

[ { type: 'tag',
    name: 'p',
    attribs: {},
    children: [ { data: 'foo', type: 'text' } ] },
  { data: '\n', type: 'text' },
  { type: 'tag',
    name: 'hr',
    attribs: {},
    children: [] },
  { data: '\n', type: 'text' },
  { type: 'tag',
    name: 'p',
    attribs: {},
    children: [ { data: 'bar', type: 'text' } ] } ]

while

<p>foo</p>
<HR>
<p>bar</p>

incorrectly results in:

[ { type: 'tag',
    name: 'p',
    attribs: {},
    children: [ { data: 'foo', type: 'text' } ] },
  { data: '\n', type: 'text' },
  { type: 'tag',
    name: 'HR',
    attribs: {},
    children: 
     [ { data: '\n', type: 'text' },
       { type: 'tag',
         name: 'p',
         attribs: {},
         children: [ { data: 'bar', type: 'text' } ] } ] } ]

Since HTML tag names are entirely case insensitive I think it would be better to lower case them so that <hr> and <HR> would both result in identical parsed output?

@fb55 fb55 closed this as completed in b00177f Jun 23, 2013
@fb55
Copy link
Owner

fb55 commented Jun 23, 2013

When the options argument wasn't specified, it defaulted to an object with the old defaults. It's now fixed.

@ForbesLindesay
Copy link
Collaborator Author

Awesome, that was very quick 😄 I look forward to the release.

@fb55
Copy link
Owner

fb55 commented Jun 23, 2013

…and 3.1.4 is out :)

@ForbesLindesay
Copy link
Collaborator Author

Thanks 😄

fb55 added a commit that referenced this issue Oct 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants