all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Deniz Dogan <deniz.a.m.dogan@gmail.com>
To: Aaron Maxwell <amax@redsymbol.net>
Cc: emacs-devel@gnu.org
Subject: Re: HTML and URL escaping functions
Date: Sun, 13 Jun 2010 21:31:17 +0200	[thread overview]
Message-ID: <AANLkTilqNAhSrBqqMjQQGu9AzdK9xLHeukCk286weu5N@mail.gmail.com> (raw)
In-Reply-To: <201006131226.27512.amax@redsymbol.net>

2010/6/13 Aaron Maxwell <amax@redsymbol.net>:
> 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")
> ; "&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.
>
> Thanks,
> Aaron
>
> --
> Aaron Maxwell
> http://redsymbol.net/
>
>

About the HTML entities: I'm not sure how you implemented it, but e.g.
sgml-mode.el has `sgml-char-names' (along with sgml-name-8bit-mode)
and I'm pretty sure nxhtml has something for it as well. I don't know
about the "URL quoting".

-- 
Deniz Dogan



  reply	other threads:[~2010-06-13 19:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-13 19:26 HTML and URL escaping functions Aaron Maxwell
2010-06-13 19:31 ` Deniz Dogan [this message]
2010-06-15 15:39   ` Aaron Maxwell
2010-06-15 21:37     ` Juri Linkov
2010-06-14 12:38 ` Mark A. Hershberger
2010-06-15 15:45   ` Aaron Maxwell
2010-06-15 17:37     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTilqNAhSrBqqMjQQGu9AzdK9xLHeukCk286weu5N@mail.gmail.com \
    --to=deniz.a.m.dogan@gmail.com \
    --cc=amax@redsymbol.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.