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

Support tag names with colons like foo:bar #134

Closed
imjoshdean opened this issue Nov 11, 2013 · 6 comments
Closed

Support tag names with colons like foo:bar #134

imjoshdean opened this issue Nov 11, 2013 · 6 comments

Comments

@imjoshdean
Copy link
Contributor

createDocumentFragment doesn't support namespaced tag names such as "mj:pane." This can be fixed by changing

getElements().join().replace(/[\w\-]+/g, function(nodeName) {

to

getElements().join().replace(/[\w\-|\w\:]+/g, function(nodeName) {

This is a bit more elegant solution than proposed in #115 as that allowed anything to be tags whereas this just allowed hyphenated tags and namespaced tags.

@WanderingZombie
Copy link

@imjoshdean puzzled as to why you're allowing the vertical bar | as a valid character?

@imjoshdean
Copy link
Contributor Author

@WanderingZombie You're right, the proper regex for that should be

/([\w\-]|[\w\:])+/g

Fixing.

@aFarkas
Copy link
Owner

aFarkas commented Nov 11, 2013

@imjoshdean

This could also work, I think:

/[\w\-\w\:]+/g

Would you also consider to update the printshiv version? Thx.

@imjoshdean
Copy link
Contributor Author

@aFarkas Consider it done. Also, that does work and is a little shorter.

@WanderingZombie
Copy link

@aFarkas /[\w\-:]+/g would be the winner on brevity I think?

@aFarkas
Copy link
Owner

aFarkas commented Nov 21, 2013

@WanderingZombie

Yes. Can I have a PR!?! :-D

@aFarkas aFarkas closed this as completed Nov 27, 2013
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