[Kbabel] Re: Highlighting

Marco Wegner dubbleu@web.de
Mon, 14 Oct 2002 19:04:39 +0200


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 14 October 2002 10:46, Stanislav Visnovsky wrote:
> On Sat, 12 Oct 2002, Marco Wegner wrote:

Okay, taking this to the mailing list now...

[ For the interested reader: Stanislav and I have discussed some issues
concerning syntax highlighting with the new QSyntaxHighlighter class whic=
h
comes with Qt 3.1 ]

> > The QSyntaxHighlighter implementation should be _very_ easy now that
> > there's no more testing ;-)
> >
> > One more question: should I color everything which looks only remotel=
y
> > like a tag/entity, i.e. "<.*>", "&.*;"?
>
> This one is hard to answer, really. Entities are easier here, since you
> can expect only letters and decimals there, but tags can be pretty
> complicated. I would just assume <[a-zA-Z].*> to be a bit more precise,
> but you have read W3C docs, haven't you?

For instance a tag where the name starts with a number (e.g. <0tagname>) =
is
invalid. I could easily check for this before highlighting. But this shou=
ld
not be done by the highlighter (quoting Stanislav: "IMHO the syntax
highlighter should simply color the text, not doing any tests."). So how =
much
testing should I do? Therefore my question whether simply to check for
"<.*>" and "&.*;" and leave the rest to validation in CatManListItem.

Marco

- --
mail@marcowegner.de
dubbleu@web.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1-cvs (GNU/Linux)

iD8DBQE9qvkwX3rotM03gSgRArQkAKClX6BUtoZFBg0oaILvNatrOHRyHQCgkHfi
cSJCMlSnFTQYQ3RaQB3Rl8I=3D
=3DTJq+
-----END PGP SIGNATURE-----