2020-06-18 22:37:24 +00:00
|
|
|
const renderEm = (tokens, idx, opts, env, slf) => {
|
2020-10-14 15:16:27 +00:00
|
|
|
const token = tokens[idx]
|
2020-06-18 22:37:24 +00:00
|
|
|
if (token.markup === '_') {
|
2020-10-14 15:16:27 +00:00
|
|
|
token.tag = 'u'
|
2020-06-18 22:37:24 +00:00
|
|
|
}
|
2020-10-14 15:16:27 +00:00
|
|
|
return slf.renderToken(tokens, idx, opts)
|
2020-06-18 22:37:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = (md) => {
|
2020-10-14 15:16:27 +00:00
|
|
|
md.renderer.rules.em_open = renderEm
|
|
|
|
md.renderer.rules.em_close = renderEm
|
2020-06-18 22:37:24 +00:00
|
|
|
}
|