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/asciidoc.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/asciidoc.js')
-rw-r--r-- | node_modules/highlight.js/lib/languages/asciidoc.js | 187 |
1 files changed, 187 insertions, 0 deletions
diff --git a/node_modules/highlight.js/lib/languages/asciidoc.js b/node_modules/highlight.js/lib/languages/asciidoc.js new file mode 100644 index 000000000..5c46f9824 --- /dev/null +++ b/node_modules/highlight.js/lib/languages/asciidoc.js @@ -0,0 +1,187 @@ +module.exports = function(hljs) { + return { + aliases: ['adoc'], + contains: [ + // block comment + hljs.COMMENT( + '^/{4,}\\n', + '\\n/{4,}$', + // can also be done as... + //'^/{4,}$', + //'^/{4,}$', + { + relevance: 10 + } + ), + // line comment + hljs.COMMENT( + '^//', + '$', + { + relevance: 0 + } + ), + // title + { + className: 'title', + begin: '^\\.\\w.*$' + }, + // example, admonition & sidebar blocks + { + begin: '^[=\\*]{4,}\\n', + end: '\\n^[=\\*]{4,}$', + relevance: 10 + }, + // headings + { + className: 'section', + relevance: 10, + variants: [ + {begin: '^(={1,5}) .+?( \\1)?$'}, + {begin: '^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$'}, + ] + }, + // document attributes + { + className: 'meta', + begin: '^:.+?:', + end: '\\s', + excludeEnd: true, + relevance: 10 + }, + // block attributes + { + className: 'meta', + begin: '^\\[.+?\\]$', + relevance: 0 + }, + // quoteblocks + { + className: 'quote', + begin: '^_{4,}\\n', + end: '\\n_{4,}$', + relevance: 10 + }, + // listing and literal blocks + { + className: 'code', + begin: '^[\\-\\.]{4,}\\n', + end: '\\n[\\-\\.]{4,}$', + relevance: 10 + }, + // passthrough blocks + { + begin: '^\\+{4,}\\n', + end: '\\n\\+{4,}$', + contains: [ + { + begin: '<', end: '>', + subLanguage: 'xml', + relevance: 0 + } + ], + relevance: 10 + }, + // lists (can only capture indicators) + { + className: 'bullet', + begin: '^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+' + }, + // admonition + { + className: 'symbol', + begin: '^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+', + relevance: 10 + }, + // inline strong + { + className: 'strong', + // must not follow a word character or be followed by an asterisk or space + begin: '\\B\\*(?![\\*\\s])', + end: '(\\n{2}|\\*)', + // allow escaped asterisk followed by word char + contains: [ + { + begin: '\\\\*\\w', + relevance: 0 + } + ] + }, + // inline emphasis + { + className: 'emphasis', + // must not follow a word character or be followed by a single quote or space + begin: '\\B\'(?![\'\\s])', + end: '(\\n{2}|\')', + // allow escaped single quote followed by word char + contains: [ + { + begin: '\\\\\'\\w', + relevance: 0 + } + ], + relevance: 0 + }, + // inline emphasis (alt) + { + className: 'emphasis', + // must not follow a word character or be followed by an underline or space + begin: '_(?![_\\s])', + end: '(\\n{2}|_)', + relevance: 0 + }, + // inline smart quotes + { + className: 'string', + variants: [ + {begin: "``.+?''"}, + {begin: "`.+?'"} + ] + }, + // inline code snippets (TODO should get same treatment as strong and emphasis) + { + className: 'code', + begin: '(`.+?`|\\+.+?\\+)', + relevance: 0 + }, + // indented literal block + { + className: 'code', + begin: '^[ \\t]', + end: '$', + relevance: 0 + }, + // horizontal rules + { + begin: '^\'{3,}[ \\t]*$', + relevance: 10 + }, + // images and links + { + begin: '(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]', + returnBegin: true, + contains: [ + { + begin: '(link|image:?):', + relevance: 0 + }, + { + className: 'link', + begin: '\\w', + end: '[^\\[]+', + relevance: 0 + }, + { + className: 'string', + begin: '\\[', + end: '\\]', + excludeBegin: true, + excludeEnd: true, + relevance: 0 + } + ], + relevance: 10 + } + ] + }; +};
\ No newline at end of file |