plugins/geshi/geshi/css.php
changeset 2 9e3258dfae15
parent 0 441963e5b07a
child 3 f3e2bbbd2155
equal deleted inserted replaced
1:c715631f809a 2:9e3258dfae15
     2 /*************************************************************************************
     2 /*************************************************************************************
     3  * css.php
     3  * css.php
     4  * -------
     4  * -------
     5  * Author: Nigel McNie (nigel@geshi.org)
     5  * Author: Nigel McNie (nigel@geshi.org)
     6  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
     6  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
     7  * Release Version: 1.0.7.20
     7  * Release Version: 1.0.8.2
     8  * Date Started: 2004/06/18
     8  * Date Started: 2004/06/18
     9  *
     9  *
    10  * CSS language file for GeSHi.
    10  * CSS language file for GeSHi.
    11  *
    11  *
    12  * CHANGES
    12  * CHANGES
    13  * -------
    13  * -------
       
    14  * 2008/05/23 (1.0.7.22)
       
    15  *  -  Added description of extra language features (SF#1970248)
    14  * 2004/11/27 (1.0.3)
    16  * 2004/11/27 (1.0.3)
    15  *  -  Added support for multiple object splitters
    17  *  -  Added support for multiple object splitters
    16  * 2004/10/27 (1.0.2)
    18  * 2004/10/27 (1.0.2)
    17  *   -  Changed regexps to catch "-" symbols
    19  *   -  Changed regexps to catch "-" symbols
    18  *   -  Added support for URLs
    20  *   -  Added support for URLs
    45  *   along with GeSHi; if not, write to the Free Software
    47  *   along with GeSHi; if not, write to the Free Software
    46  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    48  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    47  *
    49  *
    48  ************************************************************************************/
    50  ************************************************************************************/
    49 
    51 
    50 
       
    51 $language_data = array (
    52 $language_data = array (
    52 	'LANG_NAME' => 'CSS',
    53     'LANG_NAME' => 'CSS',
    53 	'COMMENT_SINGLE' => array(1 => '@'),
    54     'COMMENT_SINGLE' => array(1 => '@'),
    54 	'COMMENT_MULTI' => array('/*' => '*/'),
    55     'COMMENT_MULTI' => array('/*' => '*/'),
    55 	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
    56     'COMMENT_REGEXP' => array(
    56 	'QUOTEMARKS' => array('"', "'"),
    57         2 => "/(?<=\\()\\s*(?:(?:[a-z0-9]+?:\\/\\/)?[a-z0-9_\\-\\.\\/:]+?)?[a-z]+?\\.[a-z]+?(\\?[^\)]+?)?\\s*?(?=\\))/i"
    57 	'ESCAPE_CHAR' => '\\',
    58         ),
    58 	'KEYWORDS' => array(
    59     'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
    59 		1 => array(
    60     'QUOTEMARKS' => array('"', "'"),
       
    61     'ESCAPE_CHAR' => '\\',
       
    62     'KEYWORDS' => array(
       
    63         1 => array(
    60             'aqua', 'azimuth', 'background-attachment', 'background-color',
    64             'aqua', 'azimuth', 'background-attachment', 'background-color',
    61             'background-image', 'background-position', 'background-repeat',
    65             'background-image', 'background-position', 'background-repeat',
    62             'background', 'black', 'blue', 'border-bottom-color',
    66             'background', 'black', 'blue', 'border-bottom-color',
    63             'border-bottom-style', 'border-bottom-width', 'border-left-color',
    67             'border-bottom-style', 'border-bottom-width', 'border-left-color',
    64             'border-left-style', 'border-left-width', 'border-right',
    68             'border-left-style', 'border-left-width', 'border-right',
    86             'table-layout', 'text-align', 'text-decoration', 'text-indent',
    90             'table-layout', 'text-align', 'text-decoration', 'text-indent',
    87             'text-shadow', 'text-transform', 'top', 'unicode-bidi',
    91             'text-shadow', 'text-transform', 'top', 'unicode-bidi',
    88             'vertical-align', 'visibility', 'voice-family', 'volume',
    92             'vertical-align', 'visibility', 'voice-family', 'volume',
    89             'white-space', 'widows', 'width', 'word-spacing', 'z-index',
    93             'white-space', 'widows', 'width', 'word-spacing', 'z-index',
    90             'bottom', 'left', 'height'
    94             'bottom', 'left', 'height'
    91         ),
    95             ),
    92 		2 => array(
    96         2 => array(
    93              'above', 'absolute', 'always', 'armenian', 'aural', 'auto',
    97             'above', 'absolute', 'always', 'armenian', 'aural', 'auto',
    94              'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink',
    98             'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink',
    95              'block', 'bold', 'bolder', 'both', 'capitalize', 'center-left',
    99             'block', 'bold', 'bolder', 'both', 'capitalize', 'center-left',
    96              'center-right', 'center', 'circle', 'cjk-ideographic',
   100             'center-right', 'center', 'circle', 'cjk-ideographic',
    97              'close-quote', 'collapse', 'condensed', 'continuous', 'crop',
   101             'close-quote', 'collapse', 'condensed', 'continuous', 'crop',
    98              'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero',
   102             'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero',
    99              'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
   103             'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
   100              'e-resize', 'embed', 'extra-condensed', 'extra-expanded',
   104             'e-resize', 'embed', 'extra-condensed', 'extra-expanded',
   101              'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast',
   105             'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast',
   102              'fixed', 'fuchsia', 'georgian', 'gray', 'green', 'groove',
   106             'fixed', 'fuchsia', 'georgian', 'gray', 'green', 'groove',
   103              'hebrew', 'help', 'hidden', 'hide', 'higher', 'high',
   107             'hebrew', 'help', 'hidden', 'hide', 'higher', 'high',
   104              'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table',
   108             'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table',
   105              'inline', 'inset', 'inside', 'invert', 'italic', 'justify',
   109             'inline', 'inset', 'inside', 'invert', 'italic', 'justify',
   106              'katakana-iroha', 'katakana', 'landscape', 'larger', 'large',
   110             'katakana-iroha', 'katakana', 'landscape', 'larger', 'large',
   107              'left-side', 'leftwards', 'level', 'lighter', 'lime',
   111             'left-side', 'leftwards', 'level', 'lighter', 'lime',
   108              'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek',
   112             'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek',
   109              'lower-roman', 'lowercase', 'ltr', 'lower', 'low', 'maroon',
   113             'lower-roman', 'lowercase', 'ltr', 'lower', 'low', 'maroon',
   110              'medium', 'message-box', 'middle', 'mix', 'monospace', 'n-resize',
   114             'medium', 'message-box', 'middle', 'mix', 'monospace', 'n-resize',
   111              'narrower', 'navy', 'ne-resize', 'no-close-quote',
   115             'narrower', 'navy', 'ne-resize', 'no-close-quote',
   112              'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap',
   116             'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap',
   113              'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset',
   117             'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset',
   114              'outside', 'overline', 'pointer', 'portrait', 'purple', 'px',
   118             'outside', 'overline', 'pointer', 'portrait', 'purple', 'px',
   115              'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb',
   119             'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb',
   116              'ridge', 'right-side', 'rightwards', 's-resize', 'sans-serif',
   120             'ridge', 'right-side', 'rightwards', 's-resize', 'sans-serif',
   117              'scroll', 'se-resize', 'semi-condensed', 'semi-expanded',
   121             'scroll', 'se-resize', 'semi-condensed', 'semi-expanded',
   118              'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower',
   122             'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower',
   119              'small-caps', 'small-caption', 'smaller', 'soft', 'solid',
   123             'small-caps', 'small-caption', 'smaller', 'soft', 'solid',
   120              'spell-out', 'square', 'static', 'status-bar', 'super',
   124             'spell-out', 'square', 'static', 'status-bar', 'super',
   121              'sw-resize', 'table-caption', 'table-cell', 'table-column',
   125             'sw-resize', 'table-caption', 'table-cell', 'table-column',
   122              'table-column-group', 'table-footer-group', 'table-header-group',
   126             'table-column-group', 'table-footer-group', 'table-header-group',
   123              'table-row', 'table-row-group', 'teal', 'text', 'text-bottom',
   127             'table-row', 'table-row-group', 'teal', 'text', 'text-bottom',
   124              'text-top', 'thick', 'thin', 'transparent', 'ultra-condensed',
   128             'text-top', 'thick', 'thin', 'transparent', 'ultra-condensed',
   125              'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin',
   129             'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin',
   126              'upper-roman', 'uppercase', 'url', 'visible', 'w-resize', 'wait',
   130             'upper-roman', 'uppercase', 'url', 'visible', 'w-resize', 'wait',
   127              'white', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud',
   131             'white', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud',
   128              'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yellow',
   132             'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yellow',
   129              'yes'
   133             'yes'
   130             )
   134             )
   131         ),
   135         ),
   132 	'SYMBOLS' => array(
   136     'SYMBOLS' => array(
   133 		'(', ')', '{', '}', ':', ';'
   137         '(', ')', '{', '}', ':', ';',
   134 		),
   138         '>', '+', '*', ',', '^', '='
   135 	'CASE_SENSITIVE' => array(
   139         ),
   136 		GESHI_COMMENTS => false,
   140     'CASE_SENSITIVE' => array(
   137 		1 => true,
   141         GESHI_COMMENTS => false,
   138 		2 => true
   142         1 => true,
   139 		),
   143         2 => true
   140 	'STYLES' => array(
   144         ),
   141 		'KEYWORDS' => array(
   145     'STYLES' => array(
   142 			1 => 'color: #000000; font-weight: bold;',
   146         'KEYWORDS' => array(
   143 			2 => 'color: #993333;'
   147             1 => 'color: #000000; font-weight: bold;',
   144 			),
   148             2 => 'color: #993333;'
   145 		'COMMENTS' => array(
   149             ),
   146 			1 => 'color: #a1a100;',
   150         'COMMENTS' => array(
   147 			'MULTI' => 'color: #808080; font-style: italic;'
   151             1 => 'color: #a1a100;',
   148 			),
   152             2 => 'color: #ff0000; font-style: italic;',
   149 		'ESCAPE_CHAR' => array(
   153             'MULTI' => 'color: #808080; font-style: italic;'
   150 			0 => 'color: #000099; font-weight: bold;'
   154             ),
   151 			),
   155         'ESCAPE_CHAR' => array(
   152 		'BRACKETS' => array(
   156             0 => 'color: #000099; font-weight: bold;'
   153 			0 => 'color: #66cc66;'
   157             ),
   154 			),
   158         'BRACKETS' => array(
   155 		'STRINGS' => array(
   159             0 => 'color: #00AA00;'
   156 			0 => 'color: #ff0000;'
   160             ),
   157 			),
   161         'STRINGS' => array(
   158 		'NUMBERS' => array(
   162             0 => 'color: #ff0000;'
   159 			0 => 'color: #cc66cc;'
   163             ),
   160 			),
   164         'NUMBERS' => array(
   161 		'METHODS' => array(
   165             0 => 'color: #cc66cc;'
   162 			),
   166             ),
   163 		'SYMBOLS' => array(
   167         'METHODS' => array(
   164 			0 => 'color: #66cc66;'
   168             ),
   165 			),
   169         'SYMBOLS' => array(
   166 		'SCRIPT' => array(
   170             0 => 'color: #00AA00;'
   167 			),
   171             ),
   168 		'REGEXPS' => array(
   172         'SCRIPT' => array(
   169 			0 => 'color: #cc00cc;',
   173             ),
   170 			1 => 'color: #6666ff;',
   174         'REGEXPS' => array(
   171 			2 => 'color: #3333ff;',
   175             0 => 'color: #cc00cc;',
   172             3 => 'color: #933;',
   176             1 => 'color: #6666ff;',
   173             4 => 'color: #933;',
   177             2 => 'color: #3333ff;',
   174 			)
   178             3 => 'color: #933;'
   175 		),
   179             )
   176 	'URLS' => array(
   180         ),
   177 		1 => '',
   181     'URLS' => array(
   178 		2 => ''
   182         1 => '',
   179 		),
   183         2 => ''
   180 	'OOLANG' => false,
   184         ),
   181 	'OBJECT_SPLITTERS' => array(
   185     'OOLANG' => false,
   182 		),
   186     'OBJECT_SPLITTERS' => array(
   183 	'REGEXPS' => array(
   187         ),
   184 		0 => '\#[a-zA-Z0-9\-_]+',
   188     'REGEXPS' => array(
   185 		1 => '\.[a-zA-Z0-9\-_]+',
   189         //DOM Node ID
   186         2 => ':[a-zA-Z0-9\-]+',
   190         0 => '\#[a-zA-Z0-9\-_]+',
   187         3 => '(\d+|(\d*\.\d+))(em|ex|pt|px|cm|in|%)',
   191         //CSS classname
   188         4 => array(
   192         1 => '\.(?!\d)[a-zA-Z0-9\-_]+\b(?=[\{\.#\s,:].|<\|)',
   189             GESHI_SEARCH    => '(url\()([^)]+)(\))',
   193         //CSS Pseudo classes
   190             GESHI_REPLACE   => '\\2',
   194         //note: & is needed for &gt; (i.e. > )
   191             GESHI_BEFORE    => '\\1',
   195         2 => ':(?!\d)[a-zA-Z0-9\-]+\b(?:\s*(?=[\{\.#a-zA-Z,:+*&](.|\n)|<\|))',
   192             GESHI_AFTER     => '\\3',
   196         //Measurements
   193             GESHI_MODIFIERS => 'si'
   197         3 => '[+\-]?(\d+|(\d*\.\d+))(em|ex|pt|px|cm|in|%)',
       
   198         ),
       
   199     'STRICT_MODE_APPLIES' => GESHI_NEVER,
       
   200     'SCRIPT_DELIMITERS' => array(
       
   201         ),
       
   202     'HIGHLIGHT_STRICT_BLOCK' => array(
       
   203         ),
       
   204     'TAB_WIDTH' => 4,
       
   205     'PARSER_CONTROL' => array(
       
   206         'KEYWORDS' => array(
       
   207             'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\.])'
   194         )
   208         )
   195 		),
   209     )
   196 	'STRICT_MODE_APPLIES' => GESHI_NEVER,
       
   197 	'SCRIPT_DELIMITERS' => array(
       
   198 		),
       
   199 	'HIGHLIGHT_STRICT_BLOCK' => array(
       
   200         ),
       
   201     'TAB_WIDTH' => 4
       
   202 );
   210 );
   203 
   211 
   204 if (isset($this) && is_a($this, 'GeSHi')) {
       
   205     $language_data['STYLES']['NUMBERS'][0] = $language_data['STYLES']['REGEXPS'][3];
       
   206 }
       
   207 
       
   208 ?>
   212 ?>