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

<script> tagname handling #26

Closed
tralamazza opened this issue Oct 16, 2012 · 6 comments
Closed

<script> tagname handling #26

tralamazza opened this issue Oct 16, 2012 · 6 comments

Comments

@tralamazza
Copy link

The <script> tagname is not case insensitive. A tag <SCRIPT> will see anything starting with a < as a new tag.

Example: https://gist.github.com/3899198

@fb55
Copy link
Owner

fb55 commented Oct 16, 2012

Set options.lowerCaseTags to true and it's fixed :)

@fb55 fb55 closed this as completed Oct 16, 2012
@tralamazza
Copy link
Author

But that lowercases everything, you lose the original tag names.

In any case thanks.

btw: Some parts of the parser contain CI comparisons.

[edit] ps: You want to put that option defaulted to true, any <= will brake the parsing that otherwise looks normal.

@fb55
Copy link
Owner

fb55 commented Oct 16, 2012

CI comparisons?

That options slows parsing down in a noticeable way, plus it's not the default in the original htmlparser module. I want to keep backwards compatibility, at least in most cases.

I also started working on a state machine compiler, but it's currently far from finished. (I open-sourced a first prototype, but there are still plenty of bugs.) When it's done, I'll implement a HTML5 parser ontop of it, which should be able to replace this project. That one will be standards compilant and hopefully match this parser's performance.

@tralamazza
Copy link
Author

Nvm, the case insensitive comparisons were result of that option you mentioned.
In the end I had to implement using regexp >.< (definitely going to hell for that one).

[edit] I will check that project, thanks.

[edit2] Btw, the npm module lists 2.3.0. The 2.3.1 was not released?

@fb55
Copy link
Owner

fb55 commented Oct 16, 2012

I hate it when that happens. Anyway, there weren't any important changes, so I'm simply going to release the next version on npm.

@punund
Copy link

punund commented Dec 24, 2012

No two uppercase tags match, so it's not related to options.lowerCaseTags.

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

3 participants