[PATCH] Quote the '<' and '>' operators before inserting break

Dirk Hohndel dirk at hohndel.org
Fri May 30 07:14:07 PDT 2014


On Fri, May 30, 2014 at 08:54:13AM -0300, Tomaz Canabrava wrote:
> On Fri, May 30, 2014 at 12:57 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
> > On Fri, May 30, 2014 at 02:24:50AM +0300, Gehad wrote:
> >> Patch attached to fix the order of quoting to prevents the corruption of
> >> format.
> >
> > I'll take the patch as it's rather straight forward, but I have my
> > misgivings about the whole way quote() has been implemented.
> >
> > Take a look at the quote function in save-git.c for example... wouldn't
> > that be a much smarter design? One pass through the string, replace things
> > as you go?
> 
> QString.toHtmlScaped();

That's Qt5 only. Qt4 has .escape() - which indeed does some of what we
want but not all of it.
In general I think this would be a fine case of creating a Qt helper that
is called from C code.

It's fun to reinvent the wheel in C. It's not always the best use of time
and energy.

/D


More information about the subsurface mailing list