remarkable
remarkable copied to clipboard
Subscript and Superscript implementation
I'm wondering why subscript and superscript are implemented differently than for example bold and italic in rules.js
What I mean is that bold has strong_open and strong_close like this
rules.strong_open = function(/* tokens, idx, options, env */) {
return '<strong>';
};
rules.strong_close = function(/* tokens, idx, options, env */) {
return '</strong>';
};
but super/subscript is like this
rules.sub = function(tokens, idx /*, options, env */) {
return '<sub>' + escapeHtml(tokens[idx].content) + '</sub>';
};
so the whole thing, including content, is one token.
This means that text inside sub and sup that has other formatting is not dealt with. Wouldn't it be better if it was treated the same way as bold and italic?