Skip to content

Commit a273372

Browse files
committed
Optimise saveClones regular expression
1 parent f07f29d commit a273372

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/html5shiv-printshiv.js

+1-1
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @preserve HTML5 Shiv 3.7.4-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
2+
* @preserve HTML5 Shiv 3.7.4-pre | @afarkas @jdalton @jon_neal @rem @mina86 | MIT/GPL2 Licensed
33
*/
44
;(function(window, document) {
55
/*jshint evil:true */
@@ -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)