Skip to content

[HTML/XML] Improve SGML/DTD highlighting #272

@zufuliu

Description

@zufuliu

Created for https://sourceforge.net/p/scintilla/feature-requests/1341/

DTD test files:
https://www.w3.org/TR/xml11/#prod-notes contains
https://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd

https://www.w3.org/TR/html4/sgml/intro.html contains
https://www.w3.org/TR/html4/strict.dtd and https://www.w3.org/TR/html4/loose.dtd

https://www.w3.org/TR/SVG11/svgdtd.html#Introduction contains
https://www.w3.org/Graphics/SVG/1.1/DTD/svg11-flat-20110816.dtd

XML test files from https://www.w3.org/XML/Test/
https://www.w3.org/XML/Test/xmlts20130923.zip

xmlts20130923\xmlconf\sun\valid\pe03.xml

<!DOCTYPE root [
<!ELEMENT root (p)>
<!ELEMENT p (#PCDATA)>
<!-- Example 1 from XML spec 1.0 Appendix D -->
<!ENTITY example "<p>An ampersand (&#38;#38;) may be escaped
numerically (&#38;#38;#38) or with a general entity (&amp;amp;).</p>" >
]>
<root>&example;</root>

Here are three issues:

  1. Don't terminate SGML when > is inside quoted string (as shown in above XML).
  2. Color [ and ] as same style to make brace matching work.
  3. Nested conational section or sub-section <![xxx[ ... ]]>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    htmlCaused by the hypertext lexerxmlCaused by the xml lexer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions