bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#401: bug in HTML or XML syntax highlighting code


From: Lennart Borgman (gmail)
Subject: bug#401: bug in HTML or XML syntax highlighting code
Date: Sat, 14 Jun 2008 22:19:15 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]