diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:10:37 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-24 15:11:17 +0200 |
commit | 7a3df06eb573d36142bd1a8e03c5ce8752d300b3 (patch) | |
tree | 70bfaea8884c374876f607774850a3a51c0cb381 /node_modules/highlight.js/lib/languages/css.js | |
parent | aca1143cb9eed16cf37f04e475e4257418dd18ac (diff) | |
download | wallet-core-7a3df06eb573d36142bd1a8e03c5ce8752d300b3.tar.xz |
fix build issues and add typedoc
Diffstat (limited to 'node_modules/highlight.js/lib/languages/css.js')
-rw-r--r-- | node_modules/highlight.js/lib/languages/css.js | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/node_modules/highlight.js/lib/languages/css.js b/node_modules/highlight.js/lib/languages/css.js new file mode 100644 index 000000000..280b89941 --- /dev/null +++ b/node_modules/highlight.js/lib/languages/css.js @@ -0,0 +1,104 @@ +module.exports = function(hljs) { + var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*'; + var RULE = { + begin: /[A-Z\_\.\-]+\s*:/, returnBegin: true, end: ';', endsWithParent: true, + contains: [ + { + className: 'attribute', + begin: /\S/, end: ':', excludeEnd: true, + starts: { + endsWithParent: true, excludeEnd: true, + contains: [ + { + begin: /[\w-]+\(/, returnBegin: true, + contains: [ + { + className: 'built_in', + begin: /[\w-]+/ + }, + { + begin: /\(/, end: /\)/, + contains: [ + hljs.APOS_STRING_MODE, + hljs.QUOTE_STRING_MODE + ] + } + ] + }, + hljs.CSS_NUMBER_MODE, + hljs.QUOTE_STRING_MODE, + hljs.APOS_STRING_MODE, + hljs.C_BLOCK_COMMENT_MODE, + { + className: 'number', begin: '#[0-9A-Fa-f]+' + }, + { + className: 'meta', begin: '!important' + } + ] + } + } + ] + }; + + return { + case_insensitive: true, + illegal: /[=\/|'\$]/, + contains: [ + hljs.C_BLOCK_COMMENT_MODE, + { + className: 'selector-id', begin: /#[A-Za-z0-9_-]+/ + }, + { + className: 'selector-class', begin: /\.[A-Za-z0-9_-]+/ + }, + { + className: 'selector-attr', + begin: /\[/, end: /\]/, + illegal: '$' + }, + { + className: 'selector-pseudo', + begin: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/ + }, + { + begin: '@(font-face|page)', + lexemes: '[a-z-]+', + keywords: 'font-face page' + }, + { + begin: '@', end: '[{;]', // at_rule eating first "{" is a good thing + // because it doesn’t let it to be parsed as + // a rule set but instead drops parser into + // the default mode which is how it should be. + illegal: /:/, // break on Less variables @var: ... + contains: [ + { + className: 'keyword', + begin: /\w+/ + }, + { + begin: /\s/, endsWithParent: true, excludeEnd: true, + relevance: 0, + contains: [ + hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, + hljs.CSS_NUMBER_MODE + ] + } + ] + }, + { + className: 'selector-tag', begin: IDENT_RE, + relevance: 0 + }, + { + begin: '{', end: '}', + illegal: /\S/, + contains: [ + hljs.C_BLOCK_COMMENT_MODE, + RULE, + ] + } + ] + }; +};
\ No newline at end of file |