diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-04-02 18:19:10 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-12-22 15:00:44 +0100 |
commit | 2017cdf1390b4a98615c29880061875f426ea19c (patch) | |
tree | 35399e3aa77c7fd62894edd39fdb7a931175b223 /packages/gitbook-markdown/lib/annotate_inline.js | |
parent | d32e72acd2ffe36488c2f6b458725999149ca6ca (diff) | |
download | gitbook-2017cdf1390b4a98615c29880061875f426ea19c.zip gitbook-2017cdf1390b4a98615c29880061875f426ea19c.tar.gz gitbook-2017cdf1390b4a98615c29880061875f426ea19c.tar.bz2 |
Fix code blocks annotation
Diffstat (limited to 'packages/gitbook-markdown/lib/annotate_inline.js')
-rw-r--r-- | packages/gitbook-markdown/lib/annotate_inline.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/gitbook-markdown/lib/annotate_inline.js b/packages/gitbook-markdown/lib/annotate_inline.js index 376b092..469f4d8 100644 --- a/packages/gitbook-markdown/lib/annotate_inline.js +++ b/packages/gitbook-markdown/lib/annotate_inline.js @@ -15,19 +15,18 @@ var rules = { code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: /^~~(?=\S)([\s\S]*?\S)~~/, - text: /^[\s\S]+?(?=[\\<!\[_*`$~]|https?:\/\/| {2,}\n|$)/, - math: /^\$\$\s*([\s\S]*?[^\$])\s*\$\$(?!\$)/, + text: /^[\s\S]+?(?=[\\<!\[_*`$~]|{%([\s]*)raw([\s]*)%}|{%([\s]*)endraw([\s]*)|https?:\/\/| {2,}\n|$)/, rawStart: /^{%([\s]*)raw([\s]*)%}/, - rawEnd: /[\s\S]*{%([\s]*)endraw([\s]*)%}/ // /^{%([\s]*)endraw([\s]*)%}/ + rawEnd: /^{%([\s]*)endraw([\s]*)%}/ ///[\s\S]*{%([\s]*)endraw([\s]*)%}/ //_inside: /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/, //_href: /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/ }; // List of all the regexes we want to run var ruleTypes = [ -'escape', 'rawStart', 'rawEnd', 'autolink', 'url', 'tag', 'link', 'reflink', -'nolink', 'reffn', 'strong', 'em', 'code', 'br', -'del', 'text', 'math' + 'escape', 'autolink', 'url', 'tag', 'link', 'reflink', + 'nolink', 'reffn', 'strong', 'em', 'code', 'br', + 'del', 'rawStart', 'rawEnd', 'text' ]; // Mapping if rule type is different from token type |