Skip to content

Conversation

@LeonardoBraga
Copy link
Contributor

Closes gh-2005

Implements the recommendations from @gibson042 in this comment.

@mgol
Copy link
Member

mgol commented Oct 7, 2015

You have to exclude NULL (\0) as well, @gibson042 mentioned that in his comment.

@LeonardoBraga
Copy link
Contributor Author

@mzgol Added the missing NULL (\0) character to the exclusion list.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments on this regular expression:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I'll apply the aforementioned changes.

Regarding making it case insensitive, I considered that and did a quick research about it, but all the pieces of information I found said that the performance would be considerably lower than adding both a-z and A-Z. Just let me know if you'd rather taking the chance and making it case insensitive.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only used in association with jQuery.parseHTML; any gains would be unnoticeable in the cost of creating elements.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I'll update the code and amend the PR.

@markelog
Copy link
Member

Friendly ping

@LeonardoBraga LeonardoBraga force-pushed the manipulation-gh2005 branch 2 times, most recently from 75f679e to ec5acd9 Compare October 13, 2015 00:38
@LeonardoBraga
Copy link
Contributor Author

@gibson042 Please ignore my previous question. I think I got what you meant and updated the PR.

@LeonardoBraga LeonardoBraga force-pushed the manipulation-gh2005 branch 3 times, most recently from 17ff880 to de84b98 Compare October 13, 2015 02:48
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this! I think my only note is to be more specific about how we're respecting the spec here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My pleasure to help!

Would ...

html(String) respect the spec on how to handle special and name-terminating chars for tag names (gh-2005)

... better describe the changes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timmywil Done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LeonardoBraga Are you sure? It doesn't look like the change got committed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timmywil My apologies. It's updated now.

@LeonardoBraga LeonardoBraga force-pushed the manipulation-gh2005 branch 2 times, most recently from 828e2ca to d674651 Compare October 14, 2015 16:13
@LeonardoBraga
Copy link
Contributor Author

Just pinging to know if there's anything else I can do to help the team land this PR. Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this regex need the two negated > in a row? There's one in the modified part and one that was there originally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the two negated >, some tests fail such as this one. It seems that before, the \w was taking care of the job of the first negation, but now we're finding the name-terminating characters explicitly, we'll need to handle this ourselves.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK that makes sense, thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also include / and >.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or rather, those cases should also be tested. It looks like > is covered implicitly, so maybe just add buildChild( method, "<" + nodeName + "/>" ) into the helpers.

@gibson042
Copy link
Member

Sorry for the delay, @LeonardoBraga. Did you check the size impact of moving all the \/\0> sequence to the front of their character sets?

Other than these minor comments, it looks good to me.

@LeonardoBraga
Copy link
Contributor Author

@gibson042 Moving \/\0> to the front of the exclusion sequences produces the following differences:

raw     gz Compared to last run                                             
  =     +2 dist/jquery.js                                                   
  =     -1 dist/jquery.min.js                                               

Based on my (limited) knowledge about the libraries usage in general, I lean towards benefiting the minified version (by having \/\0> in the beginning of their exclusions lists). The PR was updated to address the comments above and move \/\0> to the beginning. Please let me know if any additional changes are required.

@LeonardoBraga
Copy link
Contributor Author

Just touching base to see if there's anything else I can do to help you guys have this PR landed. Thanks!

@mgol
Copy link
Member

mgol commented Jan 7, 2016

@LeonardoBraga Sorry for the delay, we're preparing for 1.12/2.2 simultaneous release, your PR is scheduled for 3.0.0 so we'll get to it once we're done with 1.12/2.2. :)

@gibson042 gibson042 closed this in fb9472c Jan 7, 2016
@gibson042
Copy link
Member

Thanks for your patience, @LeonardoBraga.

@LeonardoBraga
Copy link
Contributor Author

Thank you all! I'm just glad I was able to help. :-)

@LeonardoBraga LeonardoBraga deleted the manipulation-gh2005 branch January 7, 2016 22:05
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

8 participants