inline.js 477 B

123456789101112131415161718
  1. var rules = require('../rules/inline').gitbook;
  2. var engine = require('./engine');
  3. // List of all the regexes we want to run
  4. var ruleTypes = [
  5. 'escape', 'autolink', 'url', 'html', 'link', 'reflink',
  6. 'nolink', 'reffn', 'strong', 'em', 'code', 'br',
  7. 'del', 'tplexpr', 'tplvar', 'text'
  8. ];
  9. // Mapping if rule type is different from token type
  10. var ruleMap = {};
  11. function annotate(src) {
  12. return engine(src, rules, ruleTypes, ruleMap);
  13. }
  14. module.exports = annotate;