Skip to content

Commit ceed72b

Browse files
committed
Optimise saveClones regular expression
1 parent 31e22e6 commit ceed72b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/html5shiv-printshiv.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
1414

1515
/** Not all elements can be cloned in IE **/
16-
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
16+
var saveClones = /^(?:[abipq]|code|div|fieldset|h[1-6]|label|li|ol|span|strong|style|table|tbody|t[dhr]|ul)$/i;
1717

1818
/** Detect whether the browser supports default html5 styles */
1919
var supportsHtml5Styles;

src/html5shiv.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
1414

1515
/** Not all elements can be cloned in IE **/
16-
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
16+
var saveClones = /^(?:[abipq]|code|div|fieldset|h[1-6]|label|li|ol|span|strong|style|table|tbody|t[dhr]|ul)$/i;
1717

1818
/** Detect whether the browser supports default html5 styles */
1919
var supportsHtml5Styles;

0 commit comments

Comments
 (0)