[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: KOFFICE_1_3_BRANCH: koffice/tools/thesaurus
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2004-01-06 10:53:48
Message-ID: 200401061153.49092.nicolasg () snafu ! de
[Download RAW message or body]

On Sunday 04 January 2004 11:16, Jens Bäckman wrote:
> > --- koffice/tools/thesaurus/main.cc  #1.40:1.40.2.1
> > @@ -681,4 +681,5 @@ void Thesaurus::wnExited(KProcess *)
> >              }
> >              // Escape XML:
> > +            l = l.replace('&', "&amp;");
> >              l = l.replace(QRegExp("<"), "&lt;");
> >              l = l.replace(QRegExp(">"), "&gt;");
>
> Isn't this wrong? After all, this would replace "&amplt;" with "<",
> while it should be "&lt;".

No, it is the right way.

Text at start: A&<>Z
Text after first replace: A&amp;<>Z
Text after second replace: A&amp;&lt;>Z
Text after third replace: A&amp;&lt;&gt;Z

Of course the other way round HTML/XML to normla text, you have to use &amp; 
to & as last (as your example shows it.)

Have a nice day!

> _______________________________________________
> koffice-devel mailing list
> koffice-devel@mail.kde.org
> https://mail.kde.org/mailman/listinfo/koffice-devel

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic