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

Side by Side Diff: lib/src/prism/components/prism-less.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
« no previous file with comments | « lib/src/prism/components/prism-latex.min.js ('k') | lib/src/prism/components/prism-less.min.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* FIXME : 1 /* FIXME :
2 :extend() is not handled specifically : its highlighting is buggy. 2 :extend() is not handled specifically : its highlighting is buggy.
3 Mixin usage must be inside a ruleset to be highlighted. 3 Mixin usage must be inside a ruleset to be highlighted.
4 At-rules (e.g. import) containing interpolations are buggy. 4 At-rules (e.g. import) containing interpolations are buggy.
5 Detached rulesets are highlighted as at-rules. 5 Detached rulesets are highlighted as at-rules.
6 A comment before a mixin usage prevents the latter to be properly highlighted. 6 A comment before a mixin usage prevents the latter to be properly highlighted.
7 */ 7 */
8 8
9 Prism.languages.less = Prism.languages.extend('css', { 9 Prism.languages.less = Prism.languages.extend('css', {
10 'comment': [ 10 'comment': [
(...skipping 11 matching lines...) Expand all
22 }, 22 },
23 // selectors and mixins are considered the same 23 // selectors and mixins are considered the same
24 'selector': { 24 'selector': {
25 pattern: /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{ };@])*?(?=\s*\{)/, 25 pattern: /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{ };@])*?(?=\s*\{)/,
26 inside: { 26 inside: {
27 // mixin parameters 27 // mixin parameters
28 'variable': /@+[\w-]+/ 28 'variable': /@+[\w-]+/
29 } 29 }
30 }, 30 },
31 31
32 » 'property': /(\b|\B)(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i, 32 » 'property': /(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,
33 'punctuation': /[{}();:,]/, 33 'punctuation': /[{}();:,]/,
34 'operator': /[+\-*\/]/ 34 'operator': /[+\-*\/]/
35 }); 35 });
36 36
37 // Invert function and punctuation positions 37 // Invert function and punctuation positions
38 Prism.languages.insertBefore('less', 'punctuation', { 38 Prism.languages.insertBefore('less', 'punctuation', {
39 'function': Prism.languages.less.function 39 'function': Prism.languages.less.function
40 }); 40 });
41 41
42 Prism.languages.insertBefore('less', 'property', { 42 Prism.languages.insertBefore('less', 'property', {
43 'variable': [ 43 'variable': [
44 // Variable declaration (the colon must be consumed!) 44 // Variable declaration (the colon must be consumed!)
45 { 45 {
46 pattern: /@[\w-]+\s*:/, 46 pattern: /@[\w-]+\s*:/,
47 inside: { 47 inside: {
48 "punctuation": /:/ 48 "punctuation": /:/
49 } 49 }
50 }, 50 },
51 51
52 // Variable usage 52 // Variable usage
53 /@@?[\w-]+/ 53 /@@?[\w-]+/
54 ], 54 ],
55 'mixin-usage': { 55 'mixin-usage': {
56 pattern: /([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/, 56 pattern: /([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/,
57 lookbehind: true, 57 lookbehind: true,
58 alias: 'function' 58 alias: 'function'
59 } 59 }
60 }); 60 });
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-latex.min.js ('k') | lib/src/prism/components/prism-less.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698