|
|
@ -20,14 +20,21 @@ function replaceAt(str, index, ch) { |
|
|
|
return str.substr(0, index) + ch + str.substr(index + 1); |
|
|
|
} |
|
|
|
|
|
|
|
var stack = []; |
|
|
|
|
|
|
|
module.exports = function smartquotes(typographer, blockToken) { |
|
|
|
module.exports = function smartquotes(state) { |
|
|
|
/*eslint max-depth:0*/ |
|
|
|
var i, token, text, t, pos, max, thisLevel, lastSpace, nextSpace, item, canOpen, canClose, j, isSingle, chars, |
|
|
|
var i, token, text, t, pos, max, thisLevel, lastSpace, nextSpace, item, |
|
|
|
canOpen, canClose, j, isSingle, chars, blkIdx, tokens, |
|
|
|
typographer = state.typographer, |
|
|
|
options = typographer.options, |
|
|
|
tokens = blockToken.children; |
|
|
|
stack = []; |
|
|
|
|
|
|
|
|
|
|
|
for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { |
|
|
|
|
|
|
|
if (state.tokens[blkIdx].type !== 'inline') { continue; } |
|
|
|
|
|
|
|
tokens = state.tokens[blkIdx].children; |
|
|
|
stack.length = 0; |
|
|
|
|
|
|
|
for (i = 0; i < tokens.length; i++) { |
|
|
@ -99,4 +106,5 @@ module.exports = function smartquotes(typographer, blockToken) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|