Browse Source

Smartquote rule cleanup

pull/82/head
Alex Kocharin 9 years ago
parent
commit
e91574c391
  1. 4
      lib/rules_core/smartquotes.js
  2. 6
      test/fixtures/markdown-it/smartquotes.txt

4
lib/rules_core/smartquotes.js

@ -26,8 +26,6 @@ function process_inlines(tokens, state) {
for (i = 0; i < tokens.length; i++) {
token = tokens[i];
if (token.type !== 'text' || QUOTE_TEST_RE.test(token.text)) { continue; }
thisLevel = tokens[i].level;
for (j = stack.length - 1; j >= 0; j--) {
@ -35,6 +33,8 @@ function process_inlines(tokens, state) {
}
stack.length = j + 1;
if (token.type !== 'text') { continue; }
text = token.content;
pos = 0;
max = text.length;

6
test/fixtures/markdown-it/smartquotes.txt

@ -50,6 +50,12 @@ Should not match quotes on different levels:
<p><em>&quot;foo</em> bar <em>baz&quot;</em></p>
.
Smartquotes should not overlap with other tags:
.
*foo "bar* *baz" quux*
.
<p><em>foo &quot;bar</em> <em>baz&quot; quux</em></p>
.
Should try and find matching quote in this case:

Loading…
Cancel
Save