Friday, July 30, 2010

Re: [SOLVED] Re: Simple Html2Txt function , doesn't work for `&' symbol ?

On 30/07/10 10:58, Aaron Lewis wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 07/30/2010 04:55 PM, John Beckett wrote:
>> 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:
>
> Exactly working after remove all exec statements.
>
>> http://vim.wikia.com/wiki/HTML_entities
>>
>> John
>>
>
> They're much more cool , and thanks !

Within double quotes, backslashes should be doubled. If you don't want
the backslash to have any special meaning, use single quotes instead.

See
:help expr-string
:help literal-string


Best regards,
Tony.
--
Magnocartic, adj.:
Any automobile that, when left unattended, attracts shopping
carts.
-- Sniglets, "Rich Hall & Friends"

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

Post a Comment