|
4 | 4 | <title>Code Prettifier</title> |
5 | 5 | <script src="../src/prettify.js" type="text/javascript" |
6 | 6 | onerror="alert('Error: failed to load ' + this.src)"></script> |
| 7 | +<script src="../src/lang-css.js" type="text/javascript" |
| 8 | + onerror="alert('Error: failed to load ' + this.src)"></script> |
7 | 9 | <script src="../src/lang-hs.js" type="text/javascript" |
8 | 10 | onerror="alert('Error: failed to load ' + this.src)"></script> |
9 | 11 | <script src="../src/lang-lisp.js" type="text/javascript" |
@@ -993,6 +995,29 @@ <h1>Wiki syntax w/ language specified</h1> |
993 | 995 | <foo bar="baz"><boo /><foo> |
994 | 996 | }}} |
995 | 997 | </pre> |
| 998 | + |
| 999 | +<h1>CSS w/ language specified</h1> |
| 1000 | +<pre class="prettyprint lang-css" id="css"> |
| 1001 | +<!-- |
| 1002 | +@charset('UTF-8'); |
| 1003 | + |
| 1004 | +/** A url that is not quoted. */ |
| 1005 | +@import(url(/more-styles.css)); |
| 1006 | + |
| 1007 | +HTML { content-before: 'hello\20'; content-after: 'w\6f rld'; |
| 1008 | + -moz-spiff: inherit !important } |
| 1009 | + |
| 1010 | +/* Test units on numbers. */ |
| 1011 | +BODY { margin-bottom: 4px; margin-left: 3in; margin-bottom: 0; margin-top: 5% } |
| 1012 | + |
| 1013 | +/** Test number literals and quoted values. */ |
| 1014 | +TABLE.foo TR.bar A#visited { color: #001123; font-family: "monospace" } |
| 1015 | +/** bolder is not a name, so should be plain. !IMPORTANT is a keyword |
| 1016 | + * regardless of case. |
| 1017 | + */ |
| 1018 | +blink { text-decoration: BLINK !IMPORTANT; font-weight: bolder } |
| 1019 | +--> |
| 1020 | +</pre> |
996 | 1021 | </body> |
997 | 1022 |
|
998 | 1023 | <script type="text/javascript"> |
@@ -2307,6 +2332,42 @@ <h1>Wiki syntax w/ language specified</h1> |
2307 | 2332 | '`ATV"baz"`END`PUN><`END`TAGboo`END`PLN `END' + |
2308 | 2333 | '`PUN/><`END`TAGfoo`END`PUN>`END`PLN<br>' + |
2309 | 2334 | '`END`SRC}}}`END' |
| 2335 | + ), |
| 2336 | + css: ( |
| 2337 | + '`COM<!--`END`PLN<br>' + |
| 2338 | + '`END`KWD@charset`END`PUN(`END`STR\'UTF-8\'`END`PUN);`END`PLN<br>' + |
| 2339 | + '<br>' + |
| 2340 | + '`END`COM/** A url that is not quoted. */`END`PLN<br>' + |
| 2341 | + '`END`KWD@import`END`PUN(`END`KWDurl`END`STR(/more-styles.css)`END' + |
| 2342 | + '`PUN);`END`PLN<br>' + |
| 2343 | + '<br>' + |
| 2344 | + 'HTML `END`PUN{`END`PLN `END`KWDcontent-before`END`PUN:`END`PLN `END' + |
| 2345 | + '`STR\'hello\20\'`END`PUN;`END`PLN `END`KWDcontent-after`END' + |
| 2346 | + '`PUN:`END`PLN `END`STR\'w\6f rld\'`END`PUN;`END`PLN<br>' + |
| 2347 | + ' `END`KWD-moz-spiff`END`PUN:`END`PLN `END' + |
| 2348 | + '`KWDinherit`END`PLN `END`KWD!important`END`PLN `END`PUN}`END' + |
| 2349 | + '`PLN<br>' + |
| 2350 | + '<br>' + |
| 2351 | + '`END`COM/* Test units on numbers. */`END`PLN<br>' + |
| 2352 | + 'BODY `END`PUN{`END`PLN `END`KWDmargin-bottom`END`PUN:`END`PLN `END' + |
| 2353 | + '`LIT4px`END`PUN;`END`PLN `END`KWDmargin-left`END`PUN:`END' + |
| 2354 | + '`PLN `END`LIT3in`END`PUN;`END`PLN `END`KWDmargin-bottom`END' + |
| 2355 | + '`PUN:`END`PLN `END`LIT0`END`PUN;`END`PLN `END`KWDmargin-top`END' + |
| 2356 | + '`PUN:`END`PLN `END`LIT5%`END`PLN `END`PUN}`END`PLN<br>' + |
| 2357 | + '<br>' + |
| 2358 | + '`END`COM/** Test number literals and quoted values. */`END`PLN<br>' + |
| 2359 | + 'TABLE`END`PUN.`END`PLNfoo TR`END`PUN.`END`PLNbar A`END`PUN#`END' + |
| 2360 | + '`PLNvisited `END`PUN{`END`PLN `END`KWDcolor`END`PUN:`END`PLN `END' + |
| 2361 | + '`LIT#001123`END`PUN;`END`PLN `END`KWDfont-family`END`PUN:`END' + |
| 2362 | + '`PLN `END`STR"monospace"`END`PLN `END`PUN}`END`PLN<br>' + |
| 2363 | + '`END`COM/** bolder is not a name, so should be plain. ' + |
| 2364 | + ' !IMPORTANT is a keyword<br>' + |
| 2365 | + ' * regardless of case.<br>' + |
| 2366 | + ' */`END`PLN<br>' + |
| 2367 | + 'blink `END`PUN{`END`PLN `END`KWDtext-decoration`END`PUN:`END' + |
| 2368 | + '`PLN BLINK `END`KWD!IMPORTANT`END`PUN;`END`PLN `END' + |
| 2369 | + '`KWDfont-weight`END`PUN:`END`PLN bolder `END`PUN}`END`PLN<br>' + |
| 2370 | + '`END`COM-->`END' |
2310 | 2371 | ) |
2311 | 2372 | }; |
2312 | 2373 |
|
|
0 commit comments