I've got an img element with an href inside it that contains an & character for a second URL parameter. It's a Google Maps static image API call, a la https://developers.google.com/maps/documentation/staticmaps. This breaks the subsequent syntax highlighting. I've installed the latest HTML edit mode, but it's still happening.
I'm on jEdit 5.1.0 server mode, running on Java 1.7.0_45.
Line after img element should have normal highlighting; it doesn't.
I don't understand, you just have to encode & as & and it is solved right ?
Yes, encoding would resolve the issue (and not confuse the XML plugin). But HTML5 (and all major browsers) do actually allow unencoded ampersands. The slightly horrible details: http://www.w3.org/TR/html5/syntax.html#consume-a-character-reference
Syntax highlighting should handle that situation better. A fix is underway. But it will not completely cover the specification, because I won't put 2125 named character references in the mode file, or any for that matter...
(Another issue would be the XML plugin that seems to insist on encoded ampersands.)
The recommendation states that it is allowed for "historical reasons".
The XML plugin should not encourage these broken cases.
When syntax highlighting is broken a careless insertion of copy-pasted url is detected.
A fixed version can be found at https://raw.github.com/marchaefner/jEdit-modes/master/html.xml
Unencoded ampersands (that don't seem to be the start of an SGML character entity) are now marked as INVALID and don't impact subsequent highlighting.
This compromise between HTML5 and previous versions, which are all highlighted with this mode, hopefully addresses all concerns. (I retract any points I may have made about the XML plugin, it's working fine enough.)
Patch #3614699 will be updated shortly.
Fixed in svn revision 23418.