p4ulypops / jquery-clean

Automatically exported from code.google.com/p/jquery-clean
0 stars 0 forks source link

tags regexp not accepting snake-case names #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. html with tag: <my-custom-tag>xxx</my-custom-tag>

What is the expected output? What do you see instead?
expected: <my-custom-tag>xxx</my-custom-tag>
actual: <my>xxx</my>

What version of the product are you using? On what operating system?
1.4.0

Please provide any additional information below.
I fixed it by changing the regex from:
var tagsRE = /(<(\/)?(\w+:)?([\w]+)([^>]*)>)|<!--(.*?--)>/gi;

to:
var tagsRE = /(<(\/)?(\w+:)?([\w-]+)([^>]*)>)|<!--(.*?--)>/gi;

Original issue reported on code.google.com by paz.a...@yashir.co.il on 17 May 2015 at 12:34