Created
March 17, 2009 23:58
-
-
Save freels/80844 to your computer and use it in GitHub Desktop.
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
i tried to escape html in ruby | |
a task that has proved quite too easy | |
so i dusted off perl | |
and gave it a whirl: | |
while(<>){s/([<>'"&])/sprintf('&#%d;',ord($1))/eg;print;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment