Mercurial > repos > other > linux
changeset 101:845e08259ab0
Syntax highlighting strings in PHP/HTML is complicated!
Still has problems with colouring mixed HTML strings and object functions
but this seems unavoidable with the regexes we have without losing
colouring elsewhere
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 02 Apr 2018 20:17:48 +0100 |
parents | c432b0708d6d |
children | 7f49998de821 |
files | nanorc.d/php.nanorc |
diffstat | 1 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/nanorc.d/php.nanorc Mon Apr 02 20:04:38 2018 +0100 +++ b/nanorc.d/php.nanorc Mon Apr 02 20:17:48 2018 +0100 @@ -19,25 +19,24 @@ # Control flow. color magenta "\<(break|continue|goto|return)\>" -# Strings. -color yellow ""(\.|[^"])*"" "'(\.|[^'])*'" - # Numbers color blue "\b[0-9]+\b" +# General HTML +color brightblue start="<[a-zA-Z/]" end=">" +color red "&[^;[[:space:]]]*;" +color green start="<!--" end="-->" +color white start="<!DOCTYPE" end=">" +# xhtml +color white start="<\?xml" end="\?>" + +# Strings. +color yellow ""((\\")?(\.|[^"])*[^\\])?"" "'((\\')?(\.|[^'])*[^\\])?'" + # Comments. color green "(^|[[:space:]]+)//.*" color green start="/\*" end="\*/" -# General HTML -color brightblue start="<[a-zA-Z/]" end=">" -color red "&[^;[[:space:]]]*;" -color yellow "["'][^"']*["']" -color green start="<!--" end="-->" -color white start="<!DOCTYPE" end=">" -# xhtml -color white start="<\?xml" end="\?>" - # PHP tags color brightblue "<\?(php|=)|\?>"