GNU bug report logs - #401
bug in HTML or XML syntax highlighting code

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmx.net>

Date: Thu, 12 Jun 2008 20:20:03 UTC

Severity: minor

Tags: confirmed

Found in versions 24.5, 25.0.94

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, 401 <at> debbugs.gnu.org
Cc: Paul Pogonyshev <pogonyshev <at> gmx.net>, bug-gnu-emacs <at> gnu.org
Subject: bug#401: bug in HTML or XML syntax highlighting code
Date: Sat, 14 Jun 2008 22:19:15 +0200
Stefan Monnier wrote:
>> With fairly recent SVN build of Emacs I have the pasted below HTML code
>> highlighted wrongly.  Namely, "foo" is not highlighted as an attribute
>> value, apparently because there are non-corresponding (from Emacs point
>> of view) parentheses in <script>.
> 
> Indeed, part of the problem is that we use sgml-mode for this, even
> though your file doesn't seem like a properly formed SGML file.  We need
> to add special support for <script>.  Note that we do not properly
> support SGML either, e.g. if you use a CDATA[[...]] construct you'll
> bump into the same kinds of problems.

Does not nxml-mode handle this better?

>> It seems that HTML/XML mode uses two different ways to find syntactic
>> context for indenting code and for syntax-highlighting it, which I
> 
> Most/all major modes do.  The syntax-highlighting is done "globally"
> (especially the comment-vs-string-vs-code distinction), so it can get
> seriously messed up over the whole buffer in case the buffer's syntax is
> incorrect or is using constructs which the major mode doesn't
> understand.

I believe the cure to this is some multi major mode handling.





This bug report was last modified 7 years and 362 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.