summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-markdown/lib/annotate_blocks.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-04-02 18:19:10 +0200
committerSamy Pessé <samypesse@gmail.com>2016-12-22 15:00:44 +0100
commit2017cdf1390b4a98615c29880061875f426ea19c (patch)
tree35399e3aa77c7fd62894edd39fdb7a931175b223 /packages/gitbook-markdown/lib/annotate_blocks.js
parentd32e72acd2ffe36488c2f6b458725999149ca6ca (diff)
downloadgitbook-2017cdf1390b4a98615c29880061875f426ea19c.zip
gitbook-2017cdf1390b4a98615c29880061875f426ea19c.tar.gz
gitbook-2017cdf1390b4a98615c29880061875f426ea19c.tar.bz2
Fix code blocks annotation
Diffstat (limited to 'packages/gitbook-markdown/lib/annotate_blocks.js')
-rw-r--r--packages/gitbook-markdown/lib/annotate_blocks.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/gitbook-markdown/lib/annotate_blocks.js b/packages/gitbook-markdown/lib/annotate_blocks.js
index cb8ada8..3f329cb 100644
--- a/packages/gitbook-markdown/lib/annotate_blocks.js
+++ b/packages/gitbook-markdown/lib/annotate_blocks.js
@@ -16,9 +16,8 @@ var rules = { newline: /^\n+/,
table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,
paragraph: /^((?:[^\n]+\n?(?! *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\2 *(?:\n+|$)|( *)((?:[*+-]|\d+\.)) [\s\S]+?(?:\n+(?=\3?(?:[-*_] *){3,}(?:\n+|$))|\n+(?= *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$))|\n{2,}(?! )(?!\1(?:[*+-]|\d+\.) )\n*|\s*$)|( *[-*_]){3,} *(?:\n+|$)| *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)|([^\n]+)\n *(=|-){2,} *(?:\n+|$)|( *>[^\n]+(\n(?! *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$))[^\n]+)*\n*)+|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)\w+(?!:\/|[^\w\s@]*@)\b| *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)| *(\${2,}) *([\s\S]+?)\s*\1 *(?:\n+|$)))+)\n*/,
text: /^[^\n]+/,
- math: /^ *(\${2,}) *([\s\S]+?)\s*\1 *(?:\n+|$)/,
- rawStart: /^{%([\s]*)raw([\s]*)%}/,
- rawEnd: /^{%([\s]*)endraw([\s]*)%}/
+ //rawStart: /^{%([\s]*)raw([\s]*)%}/,
+ //rawEnd: /^{%([\s]*)endraw([\s]*)%}/
// These are lower level, ignore them
//bullet: /(?:[*+-]|\d+\.)/,
//item: /^( *)((?:[*+-]|\d+\.)) [^\n]*(?:\n(?!\1(?:[*+-]|\d+\.) )[^\n]*)*/gm,
@@ -27,9 +26,9 @@ var rules = { newline: /^\n+/,
// List of all the regexes we want to run
var ruleTypes = [
-'rawStart', 'rawEnd', 'newline', 'code', 'fences', 'footnote', 'math', 'heading',
-'nptable', 'lheading', 'hr', 'blockquote', 'list',
-'html', 'def', 'table', 'paragraph', 'text',
+ 'newline', 'code', 'fences', 'footnote', 'heading',
+ 'nptable', 'lheading', 'hr', 'blockquote', 'list',
+ 'html', 'def', 'table', 'paragraph', 'text',
];
// Mapping if rule type is different from token type