You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
294 B

  1. const renderEm = (tokens, idx, opts, env, slf) => {
  2. const token = tokens[idx];
  3. if (token.markup === '_') {
  4. token.tag = 'u';
  5. }
  6. return slf.renderToken(tokens, idx, opts);
  7. }
  8. module.exports = (md) => {
  9. md.renderer.rules.em_open = renderEm;
  10. md.renderer.rules.em_close = renderEm;
  11. }