November 2009
2 posts
4 tags
Corrections to Auto-print Regex
Several months ago I published a regular expression that would strip
auto-print links from webpages. Unfortunately, the regex doesn’t
actually catch everything, so here’s a corrected version:
replace(/((window|self)\.print(\(\))?|print\(\));?/ig, "");
This will catch all the following:
print()
print();
self.print
self.print()
self.print();
window.print
window.print()
window.print();
...
4 tags
Some Changes Around the Site
Last night I made some adjustments to the theme/design:
I changed my markup to be more in line with HTML5,
primarily as a result of Mark Pilgrim’s
Dive Into HTML5
chapter on the changed semantics. It’s not yet clear how microformats
will be affected, so I’ve largely left the existing classes intact.
Of note:
I had to add a CSS rule to make
HTML5 elements display as intended:
article,...