diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2015-05-27 16:14:11 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-12-22 15:00:46 +0100 |
commit | 51e6efde9ab638a04e6d4596ad1abf8c0c3b4b31 (patch) | |
tree | 27b979335792ff78d65b0a51621c7c923bac90f4 /packages/gitbook-markdown/lib/annotate_inline.js | |
parent | 6b22b7cc996330c8985755237c190fd830b89de2 (diff) | |
download | gitbook-51e6efde9ab638a04e6d4596ad1abf8c0c3b4b31.zip gitbook-51e6efde9ab638a04e6d4596ad1abf8c0c3b4b31.tar.gz gitbook-51e6efde9ab638a04e6d4596ad1abf8c0c3b4b31.tar.bz2 |
Remove annotation code and switch to kramed's annotation engine
Diffstat (limited to 'packages/gitbook-markdown/lib/annotate_inline.js')
-rw-r--r-- | packages/gitbook-markdown/lib/annotate_inline.js | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/packages/gitbook-markdown/lib/annotate_inline.js b/packages/gitbook-markdown/lib/annotate_inline.js deleted file mode 100644 index 469f4d8..0000000 --- a/packages/gitbook-markdown/lib/annotate_inline.js +++ /dev/null @@ -1,41 +0,0 @@ -var engine = require('./annotate_engine'); - -// Pulled from "kramed.InlineLexer.rules.gfm" -var rules = { - escape: /^\\([\\`*{}\[\]()#$+\-.!_>~|])/, - autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, - url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, - tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, - link: /^!?\[((?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*)\]\(\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*\)/, - reflink: /^!?\[((?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*)\]\s*\[([^\]]*)\]/, - nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, - reffn: /^!?\[\^((?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*)\]/, - strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, - code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, - br: /^ {2,}\n(?!\s*$)/, - del: /^~~(?=\S)([\s\S]*?\S)~~/, - text: /^[\s\S]+?(?=[\\<!\[_*`$~]|{%([\s]*)raw([\s]*)%}|{%([\s]*)endraw([\s]*)|https?:\/\/| {2,}\n|$)/, - rawStart: /^{%([\s]*)raw([\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', 'autolink', 'url', 'tag', 'link', 'reflink', - 'nolink', 'reffn', 'strong', 'em', 'code', 'br', - 'del', 'rawStart', 'rawEnd', 'text' -]; - -// Mapping if rule type is different from token type -var ruleMap = { - -}; - -function annotate(src) { - return engine(src, rules, ruleTypes, ruleMap); -} - -module.exports = annotate; |