[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:


Examples (there are equivalents that work on regions too):
; (html-escape-str "<whoah> nelly")
; "&lt;whoah&gt; nelly"
; (html-unescape-str "&lt;whoah&gt; 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.


Aaron Maxwell

reply via email to

[Prev in Thread] Current Thread [Next in Thread]