nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 124a859516c7299191a77c00187e7770c31571a1
parent 322120c98067a85ac84b6cb247989f4751054d61
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sun,  8 Jan 2017 11:27:37 +0100

syntax: html: be more precise with tags, and paint attribute names

A tag begins not merely with a "<" but it must be followed by an
ASCII alphabetic character or one of "/", "!" and "?".

Further, color all the valid attribute names in red.

Diffstat:
Msyntax/html.nanorc | 21+++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/syntax/html.nanorc b/syntax/html.nanorc @@ -1,11 +1,28 @@ -## Here is a short example for HTML. +## Here is an example for HTML. syntax "html" "\.html?$" magic "HTML document text" comment "<!--|-->" -color cyan start="<" end=">" +# Tags: +color cyan start="<[[:alpha:]/!?]" end=">" +# Bold, italic, and underlined: +color brightmagenta "</?[biu]>" + +# Named character references: color red "&[^;[:space:]]*;" +# Strings: color green ""(\\.|[^"])*"" +# Attributes: +color red "(abbr|accept(-charset)?|accesskey|action|alink|align|alt|archive|axis|background|bgcolor|border)=" +color red "(cell(padding|spacing)|char(off|set)?|checked|cite|class(id)?|compact|code(base|tag)?|cols(pan)?)=" +color red "(content(editable)?|contextmenu|coords|data|datetime|declare|defer|dir|disabled|enctype)=" +color red "(for|frame(border)?|headers|height|hidden|href(lang)?|hspace|http-equiv|id|ismap)=" +color red "(label|lang|link|longdesc|margin(height|width)|maxlength|media|method|multiple)=" +color red "(name|nohref|noresize|noshade|object|onclick|onfocus|onload|onmouseover|profile|readonly|rel|rev)=" +color red "(rows(pan)?|rules|scheme|scope|scrolling|selected|shape|size|span|src|standby|start|style|summary)=" +color red "(tabindex|target|text|title|type|usemap|valign|value(type)?|vlink|vspace|width|xmlns|xml:space)=" + +# Comments: color yellow start="<!--" end="-->"