Bat: Syntax for XML DTD

Created on 30 Oct 2020  路  6Comments  路  Source: sharkdp/bat

Syntax:

XML documents can have their DTD (document type definition) in an external file. These files (usually ending in .dtd) use XML syntax. Currently, DTDs are just white text. Using bat --language xml some.dtd correctly colors comments in gray, but everything else is still white, so it would be nice to have some syntax highlighting here too

Guideline Criteria:

There is no package on packagecontrol.io because XML comes with Sublime but does not support DTDs either. However, there is a closed PR with a suggestion. Maybe, one could contact the author or adapt the syntax from there? https://github.com/sublimehq/Packages/pull/985

Although this request does not conform to the specified guideline here, I think this would be a great addition. Edit: An example file can be found here: https://nmap.org/book/app-nmap-dtd.html

syntax-request

All 6 comments

Thank you for the request. Could you give a link to that PR?

Oops, I forgot to paste that :sweat: I added it in the first comment

It looks like a later PR adding DTD highlighting was merged:
https://github.com/sublimehq/Packages/pull/2152

Oh, that's right @keith-hall, it's even from the same author. Well then, I guess this should be an easy fix, just updating the submodule for the sublime repository, right?

Unfortunately it's not quite that simple - that PR was merged after some syntax definitions in that repo are using some newer features that syntect doesn't support yet. Namely https://github.com/trishume/syntect/issues/271. The solution to this for now may be to maintain our own fork with only compatible commits applied, or use the existing patch mechanism bat has.

@keith-hall That seems reasonable. I am gonna leave this issue open for others first and if noone picks it up I can PR this myself.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gwpl picture gwpl  路  3Comments

yannallain picture yannallain  路  3Comments

niedzielski picture niedzielski  路  3Comments

scalp42 picture scalp42  路  3Comments

rien333 picture rien333  路  3Comments