Friday, July 30, 2010

RE: Simple Html2Txt function , doesn't work for `&' symbol ?

Aaron Lewis wrote:
> Consider following function , i tried to do a simple
> html conversation, not working for the third one ?
>
> function HtmlToText()
> exec "%s/&lt;/</g"
> exec "%s/&gt;/>/g"
> exec "%s/&amp;/\&/g"
> endfunc

Probably something to do with using a double-quoted string
(try :echo "a\&b").

You do not need to "execute" a command, so just omit all the
"exec" and quotes. The tip with the polished product is:
http://vim.wikia.com/wiki/HTML_entities

John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: