Created
June 21, 2011 14:57
-
-
Save mala/1038024 to your computer and use it in GitHub Desktop.
quick patch script for jQuery http://bugs.jquery.com/ticket/9521
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
# perl jquery_patch.pl jquery-n.nn.min.js > jquery-n.nn.min.patched.js | |
$old = join "|", map quotemeta, ( | |
q{/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/}, | |
q{/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/}, | |
q{/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/} | |
); | |
$new = q{/^(?:\s*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/}; | |
while(<>){ print "/* patched */\n" if (s/$old/$new/); print $_ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment