fix(markdown/table): use `Token.attr[Get|Join]` insteed the hardcode `tabindex` attr

pull/4082/head
TheNorthMemory 1 year ago
parent 8f31a4c078
commit 935e2c1052
No known key found for this signature in database
GPG Key ID: B3A81A8298701131

@ -231,8 +231,12 @@ export const createMarkdownRenderer = async (
)
.use(lineNumberPlugin, options.lineNumbers)
const orgi = md.renderer.rules.table_open
md.renderer.rules.table_open = function (tokens, idx, options, env, self) {
return '<table tabindex="0">\n'
tokens[idx].attrGet('tabindex') ?? tokens[idx].attrJoin('tabindex', '0')
return orgi
? orgi(tokens, idx, options, env, self)
: self.renderToken(tokens, idx, options)
}
if (options.gfmAlerts !== false) {

Loading…
Cancel
Save