[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
HTML and URL escaping functions
From: |
Aaron Maxwell |
Subject: |
HTML and URL escaping functions |
Date: |
Sun, 13 Jun 2010 12:26:27 -0700 |
User-agent: |
KMail/1.9.9 |
Hi all,
I wrote a few functions for escaping text with HTML entities, and back; and
for quoting strings for inclusion in HTTP URLs, and back. The code is here:
http://gist.github.com/436913
Examples (there are equivalents that work on regions too):
; (html-escape-str "<whoah> nelly")
; "<whoah> nelly"
; (html-unescape-str "<whoah> nelly")
; "<whoah> nelly"
; (url-quote-str "ab/c de/f")
; "ab/c%20de/f"
; (url-unquote-str "ab/c%20de/f")
; "ab/c de/f"
It needs some work, but is probably far enough along to be useful.
Do you know if this exists already, in some free software library? I haven't
been able to find equivalents anywhere. I partly wrote this to practice
elisp, so it's okay if this is reinventing a wheel. If not, I'd like to
clean it up so others can use it.
Thanks,
Aaron
--
Aaron Maxwell
http://redsymbol.net/
- HTML and URL escaping functions,
Aaron Maxwell <=