Created
April 24, 2012 08:49
-
-
Save hadashiA/2478018 to your computer and use it in GitHub Desktop.
HTML special char quote
This file contains 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
(defun html-quote (str) | |
(replace-regexp-in-string "[&<>]" | |
(lambda (m) | |
(or (cdr (assq (string-to-char m) | |
'((?& . "&") | |
(?< . "<") | |
(?> . ">")))) | |
m)) | |
str)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment