emacsweblogs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacsweblogs] XMLified Characters


From: puneet goel
Subject: [Emacsweblogs] XMLified Characters
Date: Tue, 9 Mar 2010 15:35:30 +0530

Greetings

OK, let me first confess that I am not expert in XML-RPC etc. So what
I am talking about here might have some obvious solution which I might
not be aware of.

I have been using weblogger for a while to maintain a couple of tech
blogs. And since these are tech blogs, they do have a lot of code
snippets thrown in. I am using wordpress with SyntaxHighlighter
evolved plugin to maintain these blogs.

When I use weblogger to edit my blog entry, all the special characters
in the blog, mainly <,>,&, and " appear XML-escaped like &lt, &gt,
&amp etc. And since these characters appear a lot in the code snippets
that I put on my blogs, this becomes a big nuisance.

So I am using the following hack in my configuration to help solve the
problem ....

(add-hook 'weblogger-start-edit-entry-hook
          (lambda()
            (let* ((old-contents (buffer-string))
                   (new-contents (xml-substitute-special old-contents)))
              (delete-region (buffer-end -1) (buffer-end 1))
              (insert new-contents))
            (flyspell-mode 1)
            (flyspell-buffer)   ; spell check the fetched post
            (auto-fill-mode -1)
            (visual-line-mode 1)
            ))

The operative part here is the use of xml-substitute-special to
de-escape the XMLified characters.

I am wondering if other people who use weblogger, also face this
problem and if this hack could be imported as part of the weblogger-el
itself.

Regards
- Puneet




reply via email to

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