2019-01-05 12:53:26 +01:00
|
|
|
## HTML syntax highlighting rules for Nano
|
|
|
|
|
2019-12-18 15:34:49 +01:00
|
|
|
syntax "HTML" "\.html?(.j2)?(.twig)?$"
|
2019-01-05 12:53:26 +01:00
|
|
|
magic "HTML document"
|
|
|
|
comment "<!--|-->"
|
2023-04-13 16:13:39 +02:00
|
|
|
tabgives " "
|
2019-01-05 12:53:26 +01:00
|
|
|
|
|
|
|
## Emphasis tags
|
|
|
|
color brightwhite start="<([biu]|em|strong)[^>]*>" end="</([biu]|em|strong)>"
|
|
|
|
|
|
|
|
## Tags
|
|
|
|
color cyan start="<" end=">"
|
|
|
|
|
|
|
|
## Attributes
|
|
|
|
color brightblue "[[:space:]](abbr|accept(-charset)?|accesskey|action|[av]?link|alt|archive|axis|background|(bg)?color|border)="
|
|
|
|
color brightblue "[[:space:]](cell(padding|spacing)|char(off|set)?|checked|cite|class(id)?|compact|code(base|tag)?|cols(pan)?)="
|
|
|
|
color brightblue "[[:space:]](content(editable)?|contextmenu|coords|data|datetime|declare|defer|dir|enctype)="
|
|
|
|
color brightblue "[[:space:]](for|frame(border)?|headers|height|hidden|href(lang)?|hspace|http-equiv|id|ismap)="
|
|
|
|
color brightblue "[[:space:]](label|lang|longdesc|margin(height|width)|maxlength|media|method|multiple)="
|
|
|
|
color brightblue "[[:space:]](name|nohref|noresize|noshade|object|on(click|focus|load|mouseover|keypress)|profile|readonly|rel|rev)="
|
|
|
|
color brightblue "[[:space:]](rows(pan)?|rules|scheme|scope|scrolling|shape|size|span|src|standby|start|style|summary|pattern)="
|
|
|
|
color brightblue "[[:space:]](tabindex|target|text|title|type|usemap|v?align|value(type)?|vspace|width|xmlns|xml:space)="
|
|
|
|
color brightblue "[[:space:]](required|disabled|selected)[[:space:]=>]"
|
|
|
|
|
|
|
|
## Strings
|
|
|
|
color yellow ""(\\.|[^"])*""
|
|
|
|
|
|
|
|
## Named character references and entities
|
|
|
|
color red "&#?[[:alnum:]]*;"
|
|
|
|
|
|
|
|
## Template strings (not in the HTML spec, but very commonly used)
|
2020-10-08 17:43:13 +02:00
|
|
|
color magenta "\{[^\}]*\}\}?"
|
2019-01-05 12:53:26 +01:00
|
|
|
color brightgreen "[[:space:]]((end)?if|(end)?for|in|not|(end)?block)[[:space:]]"
|
|
|
|
|
|
|
|
## Comments
|
|
|
|
color green start="<!--" end="-->"
|
2016-12-06 22:03:16 +01:00
|
|
|
|
|
|
|
## Trailing spaces
|
|
|
|
color ,green "[[:space:]]+$"
|
2019-01-05 12:53:26 +01:00
|
|
|
|
|
|
|
## Reminders
|
|
|
|
color brightwhite,yellow "(FIXME|TODO|XXX)"
|