Skip to content

Commit

Permalink
Markdown tables middle align
Browse files Browse the repository at this point in the history
  • Loading branch information
CypherX committed Aug 6, 2023
1 parent 9d07651 commit acca203
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12800,6 +12800,10 @@ md.renderer.rules.table_open = (tokens, idx, options, env, self) => {
md.renderer.rules.table_close = (tokens, idx, options, env, self) => {
return '</table></div>';
};
md.renderer.rules.td_open = (tokens, idx, options, env, self) => {
tokens[idx].attrPush(['class', 'align-middle']);
return proxy(tokens, idx, options, env, self);
};

module.exports = {
md,
Expand Down
4 changes: 4 additions & 0 deletions scripts/markdown-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ md.renderer.rules.table_open = (tokens, idx, options, env, self) => {
md.renderer.rules.table_close = (tokens, idx, options, env, self) => {
return '</table></div>';
};
md.renderer.rules.td_open = (tokens, idx, options, env, self) => {
tokens[idx].attrPush(['class', 'align-middle']);
return proxy(tokens, idx, options, env, self);
};

module.exports = {
md,
Expand Down

0 comments on commit acca203

Please sign in to comment.