From 419e028f5f9b948cfe7399052cbe4ea68be74ebf Mon Sep 17 00:00:00 2001 From: Christian Nicolai Date: Wed, 17 Aug 2011 23:58:48 +0200 Subject: [PATCH] Made CSS parser aware when in html/php files The HTML highlighter (called from php.jsf) will "inherit" the php-flag to css.jsf so it calls php.jsf again on . --- css.jsf | 20 +++++++++++++++++--- html.jsf | 4 ++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/css.jsf b/css.jsf index c07b684..68ce960 100644 --- a/css.jsf +++ b/css.jsf @@ -13,6 +13,9 @@ =Keyword bold =HTML +# from html.jsf to support +=TagEdge green + :begin Idle * begin noeat call=.css() @@ -24,15 +27,26 @@ :reset HTML * reset - "<" maybe_done + "<" maybe_done recolor=-1 "/" slash "#" id_block recolor=-1 "." class_block recolor=-1 "a-zA-Z" tag_block recolor=-1 -:maybe_done HTML - * reset noeat +:maybe_done TagEdge + * reset_html noeat "/" reset noeat return recolor=-2 +.ifdef php + "?%" rtn_php call=php.php() +.endif + +# fix needed to produce similar output without php +:reset_html HTML + * reset noeat recolor=-2 + +# this state allows php and perl to recolor the ?> %> or &> properly. +:rtn_php TagEdge + * reset noeat :slash Idle * reset noeat diff --git a/html.jsf b/html.jsf index 44573d1..7a0ba94 100644 --- a/html.jsf +++ b/html.jsf @@ -204,7 +204,11 @@ done "-A-Za-z0-9._:" ytag_value :ytag_end TagEdge +.ifdef php + * tag_begin call=css.css(php) +.else * tag_begin call=css.css() +.endif :ytag_done TagEdge * tag_name_first buffer noeat