Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Side by Side Diff: lib/src/prism/components/prism-css.js

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 Prism.languages.css = { 1 Prism.languages.css = {
2 'comment': /\/\*[\w\W]*?\*\//, 2 'comment': /\/\*[\w\W]*?\*\//,
3 'atrule': { 3 'atrule': {
4 pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i, 4 pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i,
5 inside: { 5 inside: {
6 'rule': /@[\w-]+/ 6 'rule': /@[\w-]+/
7 // See rest below 7 // See rest below
8 } 8 }
9 }, 9 },
10 'url': /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, 10 'url': /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
11 'selector': /[^\{\}\s][^\{\};]*?(?=\s*\{)/, 11 'selector': /[^\{\}\s][^\{\};]*?(?=\s*\{)/,
12 'string': /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/, 12 'string': /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,
13 'property': /(\b|\B)[\w-]+(?=\s*:)/i, 13 'property': /(\b|\B)[\w-]+(?=\s*:)/i,
14 'important': /\B!important\b/i, 14 'important': /\B!important\b/i,
15 'function': /[-a-z0-9]+(?=\()/i, 15 'function': /[-a-z0-9]+(?=\()/i,
16 'punctuation': /[(){};:]/ 16 'punctuation': /[(){};:]/
17 }; 17 };
18 18
19 Prism.languages.css['atrule'].inside.rest = Prism.util.clone(Prism.languages.css ); 19 Prism.languages.css['atrule'].inside.rest = Prism.util.clone(Prism.languages.css );
20 20
21 if (Prism.languages.markup) { 21 if (Prism.languages.markup) {
22 Prism.languages.insertBefore('markup', 'tag', { 22 Prism.languages.insertBefore('markup', 'tag', {
23 'style': { 23 'style': {
24 » » » pattern: /<style[\w\W]*?>[\w\W]*?<\/style>/i, 24 » » » pattern: /(<style[\w\W]*?>)[\w\W]*?(?=<\/style>)/i,
25 » » » inside: { 25 » » » lookbehind: true,
26 » » » » 'tag': { 26 » » » inside: Prism.languages.css,
27 » » » » » pattern: /<style[\w\W]*?>|<\/style>/i,
28 » » » » » inside: Prism.languages.markup.tag.insid e
29 » » » » },
30 » » » » rest: Prism.languages.css
31 » » » },
32 alias: 'language-css' 27 alias: 'language-css'
33 } 28 }
34 }); 29 });
35 30
36 Prism.languages.insertBefore('inside', 'attr-value', { 31 Prism.languages.insertBefore('inside', 'attr-value', {
37 'style-attr': { 32 'style-attr': {
38 pattern: /\s*style=("|').*?\1/i, 33 pattern: /\s*style=("|').*?\1/i,
39 inside: { 34 inside: {
40 'attr-name': { 35 'attr-name': {
41 pattern: /^\s*style/i, 36 pattern: /^\s*style/i,
42 inside: Prism.languages.markup.tag.insid e 37 inside: Prism.languages.markup.tag.insid e
43 }, 38 },
44 'punctuation': /^\s*=\s*['"]|['"]\s*$/, 39 'punctuation': /^\s*=\s*['"]|['"]\s*$/,
45 'attr-value': { 40 'attr-value': {
46 pattern: /.+/i, 41 pattern: /.+/i,
47 inside: Prism.languages.css 42 inside: Prism.languages.css
48 } 43 }
49 }, 44 },
50 alias: 'language-css' 45 alias: 'language-css'
51 } 46 }
52 }, Prism.languages.markup.tag); 47 }, Prism.languages.markup.tag);
53 } 48 }
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-crystal.min.js ('k') | lib/src/prism/components/prism-css.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698