horizontalRule.js 645 B

123456789101112131415
  1. /**
  2. * Turn Markdown link shortcuts into XHTML <a> tags.
  3. */
  4. showdown.subParser('makehtml.horizontalRule', function (text, options, globals) {
  5. 'use strict';
  6. text = globals.converter._dispatch('makehtml.horizontalRule.before', text, options, globals).getText();
  7. var key = showdown.subParser('makehtml.hashBlock')('<hr />', options, globals);
  8. text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
  9. text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
  10. text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
  11. text = globals.converter._dispatch('makehtml.horizontalRule.after', text, options, globals).getText();
  12. return text;
  13. });