# HG changeset patch # User IBBoard # Date 1522696668 -3600 # Node ID 845e08259ab05e8ac1c99137f02915df46465afe # Parent c432b0708d6defc198fe9bf44f578b8e585c43fb 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 diff -r c432b0708d6d -r 845e08259ab0 nanorc.d/php.nanorc --- 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="" +color white start="" +# 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="" -color white start="" -# xhtml -color white start="<\?xml" end="\?>" - # PHP tags color brightblue "<\?(php|=)|\?>"