1 | 1 | simandl | <?php |
2 | | | /************************************************************************************* |
3 | | | * css.php |
4 | | | * ------- |
5 | | | * Author: Nigel McNie (nigel@geshi.org) |
6 | | | * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/) |
7 | 3 | simandl | * Release Version: 1.0.8.3 |
8 | 1 | simandl | * Date Started: 2004/06/18 |
9 | | | * |
10 | | | * CSS language file for GeSHi. |
11 | | | * |
12 | | | * CHANGES |
13 | | | * ------- |
14 | | | * 2008/05/23 (1.0.7.22) |
15 | | | * - Added description of extra language features (SF#1970248) |
16 | | | * 2004/11/27 (1.0.3) |
17 | | | * - Added support for multiple object splitters |
18 | | | * 2004/10/27 (1.0.2) |
19 | | | * - Changed regexps to catch "-" symbols |
20 | | | * - Added support for URLs |
21 | | | * 2004/08/05 (1.0.1) |
22 | | | * - Added support for symbols |
23 | | | * 2004/07/14 (1.0.0) |
24 | | | * - First Release |
25 | | | * |
26 | | | * TODO (updated 2004/11/27) |
27 | | | * ------------------------- |
28 | | | * * Improve or drop regexps for class/id/psuedoclass highlighting |
29 | | | * * Re-look at keywords - possibly to make several CSS language |
30 | | | * files, all with different versions of CSS in them |
31 | | | * |
32 | | | ************************************************************************************* |
33 | | | * |
34 | | | * This file is part of GeSHi. |
35 | | | * |
36 | | | * GeSHi is free software; you can redistribute it and/or modify |
37 | | | * it under the terms of the GNU General Public License as published by |
38 | | | * the Free Software Foundation; either version 2 of the License, or |
39 | | | * (at your option) any later version. |
40 | | | * |
41 | | | * GeSHi is distributed in the hope that it will be useful, |
42 | | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
43 | | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
44 | | | * GNU General Public License for more details. |
45 | | | * |
46 | | | * You should have received a copy of the GNU General Public License |
47 | | | * along with GeSHi; if not, write to the Free Software |
48 | | | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
49 | | | * |
50 | | | ************************************************************************************/ |
51 | | | |
52 | | | $language_data = array ( |
53 | | | 'LANG_NAME' => 'CSS', |
54 | | | 'COMMENT_SINGLE' => array(1 => '@'), |
55 | | | 'COMMENT_MULTI' => array('/*' => '*/'), |
56 | | | 'COMMENT_REGEXP' => array( |
57 | | | 2 => "/(?<=\\()\\s*(?:(?:[a-z0-9]+?:\\/\\/)?[a-z0-9_\\-\\.\\/:]+?)?[a-z]+?\\.[a-z]+?(\\?[^\)]+?)?\\s*?(?=\\))/i" |
58 | | | ), |
59 | | | 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, |
60 | | | 'QUOTEMARKS' => array('"', "'"), |
61 | | | 'ESCAPE_CHAR' => '\\', |
62 | | | 'KEYWORDS' => array( |
63 | | | 1 => array( |
64 | | | 'aqua', 'azimuth', 'background-attachment', 'background-color', |
65 | | | 'background-image', 'background-position', 'background-repeat', |
66 | | | 'background', 'black', 'blue', 'border-bottom-color', |
67 | | | 'border-bottom-style', 'border-bottom-width', 'border-left-color', |
68 | | | 'border-left-style', 'border-left-width', 'border-right', |
69 | | | 'border-right-color', 'border-right-style', 'border-right-width', |
70 | | | 'border-top-color', 'border-top-style', |
71 | | | 'border-top-width','border-bottom', 'border-collapse', |
72 | | | 'border-left', 'border-width', 'border-color', 'border-spacing', |
73 | | | 'border-style', 'border-top', 'border', 'caption-side', 'clear', |
74 | | | 'clip', 'color', 'content', 'counter-increment', 'counter-reset', |
75 | | | 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display', |
76 | | | 'elevation', 'empty-cells', 'float', 'font-family', 'font-size', |
77 | | | 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', |
78 | | | 'font-weight', 'font', 'line-height', 'letter-spacing', |
79 | | | 'list-style', 'list-style-image', 'list-style-position', |
80 | | | 'list-style-type', 'margin-bottom', 'margin-left', 'margin-right', |
81 | | | 'margin-top', 'margin', 'marker-offset', 'marks', 'max-height', |
82 | | | 'max-width', 'min-height', 'min-width', 'orphans', 'outline', |
83 | | | 'outline-color', 'outline-style', 'outline-width', 'overflow', |
84 | | | 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', |
85 | | | 'padding', 'page', 'page-break-after', 'page-break-before', |
86 | | | 'page-break-inside', 'pause-after', 'pause-before', 'pause', |
87 | | | 'pitch', 'pitch-range', 'play-during', 'position', 'quotes', |
88 | | | 'richness', 'right', 'size', 'speak-header', 'speak-numeral', |
89 | | | 'speak-punctuation', 'speak', 'speech-rate', 'stress', |
90 | | | 'table-layout', 'text-align', 'text-decoration', 'text-indent', |
91 | | | 'text-shadow', 'text-transform', 'top', 'unicode-bidi', |
92 | | | 'vertical-align', 'visibility', 'voice-family', 'volume', |
93 | | | 'white-space', 'widows', 'width', 'word-spacing', 'z-index', |
94 | | | 'bottom', 'left', 'height' |
95 | | | ), |
96 | | | 2 => array( |
97 | | | 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', |
98 | | | 'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink', |
99 | | | 'block', 'bold', 'bolder', 'both', 'capitalize', 'center-left', |
100 | | | 'center-right', 'center', 'circle', 'cjk-ideographic', |
101 | | | 'close-quote', 'collapse', 'condensed', 'continuous', 'crop', |
102 | | | 'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero', |
103 | | | 'decimal', 'default', 'digits', 'disc', 'dotted', 'double', |
104 | | | 'e-resize', 'embed', 'extra-condensed', 'extra-expanded', |
105 | | | 'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast', |
106 | | | 'fixed', 'fuchsia', 'georgian', 'gray', 'green', 'groove', |
107 | | | 'hebrew', 'help', 'hidden', 'hide', 'higher', 'high', |
108 | | | 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', |
109 | | | 'inline', 'inset', 'inside', 'invert', 'italic', 'justify', |
110 | | | 'katakana-iroha', 'katakana', 'landscape', 'larger', 'large', |
111 | | | 'left-side', 'leftwards', 'level', 'lighter', 'lime', |
112 | | | 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', |
113 | | | 'lower-roman', 'lowercase', 'ltr', 'lower', 'low', 'maroon', |
114 | | | 'medium', 'message-box', 'middle', 'mix', 'monospace', 'n-resize', |
115 | | | 'narrower', 'navy', 'ne-resize', 'no-close-quote', |
116 | | | 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', |
117 | | | 'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset', |
118 | | | 'outside', 'overline', 'pointer', 'portrait', 'purple', 'px', |
119 | | | 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', |
120 | | | 'ridge', 'right-side', 'rightwards', 's-resize', 'sans-serif', |
121 | | | 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', |
122 | | | 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', |
123 | | | 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', |
124 | | | 'spell-out', 'square', 'static', 'status-bar', 'super', |
125 | | | 'sw-resize', 'table-caption', 'table-cell', 'table-column', |
126 | | | 'table-column-group', 'table-footer-group', 'table-header-group', |
127 | | | 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', |
128 | | | 'text-top', 'thick', 'thin', 'transparent', 'ultra-condensed', |
129 | | | 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', |
130 | | | 'upper-roman', 'uppercase', 'url', 'visible', 'w-resize', 'wait', |
131 | | | 'white', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud', |
132 | | | 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yellow', |
133 | | | 'yes' |
134 | | | ) |
135 | | | ), |
136 | | | 'SYMBOLS' => array( |
137 | | | '(', ')', '{', '}', ':', ';', |
138 | | | '>', '+', '*', ',', '^', '=' |
139 | | | ), |
140 | | | 'CASE_SENSITIVE' => array( |
141 | | | GESHI_COMMENTS => false, |
142 | | | 1 => true, |
143 | | | 2 => true |
144 | | | ), |
145 | | | 'STYLES' => array( |
146 | | | 'KEYWORDS' => array( |
147 | | | 1 => 'color: #000000; font-weight: bold;', |
148 | | | 2 => 'color: #993333;' |
149 | | | ), |
150 | | | 'COMMENTS' => array( |
151 | | | 1 => 'color: #a1a100;', |
152 | | | 2 => 'color: #ff0000; font-style: italic;', |
153 | | | 'MULTI' => 'color: #808080; font-style: italic;' |
154 | | | ), |
155 | | | 'ESCAPE_CHAR' => array( |
156 | | | |
157 | | | ), |
158 | | | 'BRACKETS' => array( |
159 | | | |
160 | | | ), |
161 | | | 'STRINGS' => array( |
162 | | | |
163 | | | ), |
164 | | | 'NUMBERS' => array( |
165 | | | |
166 | | | ), |
167 | | | 'METHODS' => array( |
168 | | | ), |
169 | | | 'SYMBOLS' => array( |
170 | | | |
171 | | | ), |
172 | | | 'SCRIPT' => array( |
173 | | | ), |
174 | | | 'REGEXPS' => array( |
175 | | | |
176 | | | 1 => 'color: #6666ff;', |
177 | | | 2 => 'color: #3333ff;', |
178 | | | 3 => 'color: #933;' |
179 | | | ) |
180 | | | ), |
181 | | | 'URLS' => array( |
182 | | | 1 => '', |
183 | | | 2 => '' |
184 | | | ), |
185 | | | 'OOLANG' => false, |
186 | | | 'OBJECT_SPLITTERS' => array( |
187 | | | ), |
188 | | | 'REGEXPS' => array( |
189 | | | //DOM Node ID |
190 | 3 | simandl | |
191 | 1 | simandl | //CSS classname |
192 | 3 | simandl | 1 => '\.(?!\d)[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*\b(?=[\{\.#\s,:].|<\|)', |
193 | 1 | simandl | //CSS Pseudo classes |
194 | | | //note: & is needed for > (i.e. > ) |
195 | 3 | simandl | 2 => '(?<!\\\\):(?!\d)[a-zA-Z0-9\-]+\b(?:\s*(?=[\{\.#a-zA-Z,:+*&](.|\n)|<\|))', |
196 | 1 | simandl | //Measurements |
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_\|%\\-&\.])' |
208 | | | ) |
209 | | | ) |
210 | | | ); |
211 | | | |
212 | 3 | simandl | ?> |