wikijs-fork/server/modules/rendering/markdown-core/underline.js
Regev Brody e03a80dccc
feat: underline markdown support (#2073)
* fix: no markdown support for underline #2072
2020-06-18 18:37:24 -04:00

13 lines
294 B
JavaScript

const renderEm = (tokens, idx, opts, env, slf) => {
const token = tokens[idx];
if (token.markup === '_') {
token.tag = 'u';
}
return slf.renderToken(tokens, idx, opts);
}
module.exports = (md) => {
md.renderer.rules.em_open = renderEm;
md.renderer.rules.em_close = renderEm;
}