Browse Source

Fix subscript and superscript rules

pull/14/head
Alex Kocharin 10 years ago
parent
commit
f28ab537e4
  1. 4
      lib/rules_inline/sup.js
  2. 2
      test/fixtures/remarkable/sub.txt

4
lib/rules_inline/sup.js

@ -57,9 +57,9 @@ module.exports = function sup(state, silent) {
state.pos = start + 1; state.pos = start + 1;
if (!silent) { if (!silent) {
state.push({ type: 'sub_open', level: state.level++ }); state.push({ type: 'sup_open', level: state.level++ });
state.parser.tokenize(state); state.parser.tokenize(state);
state.push({ type: 'sub_close', level: --state.level }); state.push({ type: 'sup_close', level: --state.level });
} }
state.pos = state.posMax + 1; state.pos = state.posMax + 1;

2
test/fixtures/remarkable/sub.txt

@ -2,7 +2,7 @@
. .
~foo ~bar~ baz~ ~foo ~bar~ baz~
. .
<p><sup>foo <sup>bar</sup> baz</sup></p> <p><sub>foo <sub>bar</sub> baz</sub></p>
. .
. .

Loading…
Cancel
Save