diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 3f56dd606b32..ebcdbd366df3 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -27,6 +27,7 @@ | diff | ✓ | | | | | dockerfile | ✓ | | | `docker-langserver` | | dot | ✓ | | | `dot-language-server` | +| dtd | ✓ | | | | | edoc | ✓ | | | | | eex | ✓ | | | | | ejs | ✓ | | | | diff --git a/languages.toml b/languages.toml index c643beab19c9..3fb96365075d 100644 --- a/languages.toml +++ b/languages.toml @@ -2099,6 +2099,26 @@ roots = [] name = "xml" source = { git = "https://github.com/RenjiSann/tree-sitter-xml", rev = "48a7c2b6fb9d515577e115e6788937e837815651" } + +[[language]] +name = "dtd" +scope = "source.dtd" +injection-regex = "dtd" +file-types = ["dtd", "ent"] +indent = {tab-width = 2, unit = " "} +roots = [] + +[language.auto-pairs] +'(' = ')' +'[' = ']' +'"' = '"' +"'" = "'" +'<' = '>' + +[[grammar]] +name = "dtd" +source = { git = "https://github.com/KMikeeU/tree-sitter-dtd", rev = "6116becb02a6b8e9588ef73d300a9ba4622e156f"} + [[language]] name = "wit" scope = "source.wit" diff --git a/runtime/queries/dtd/highlights.scm b/runtime/queries/dtd/highlights.scm new file mode 100644 index 000000000000..cb3d482b5aec --- /dev/null +++ b/runtime/queries/dtd/highlights.scm @@ -0,0 +1,39 @@ +; highlights.scm + +(comment) @comment + +[ + "ELEMENT" + "ATTLIST" +] @keyword + +[ + "#REQUIRED" + "#IMPLIED" + "#FIXED" + "#PCDATA" +] @keyword.directive + +[ + "EMPTY" + "ANY" + "SYSTEM" + "PUBLIC" +] @constant + +(element_name) @module + + +(attribute_name) @attribute + +(system_literal) @string +(pubid_literal) @string +(attribute_value) @string + +[ + ">" + "" + "