Skip to content

Commit

Permalink
fix(tokenizer): closing tag inside fenced block should be ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Apr 26, 2016
1 parent d7f2793 commit 3566bc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ function matchRecursive (str, opener, closer) {
continue
}
if (openTokens) {
const inside = str.slice(matchStartIndex, match.index)
if ((inside.match(/```/g) || []).length % 2 !== 0) continue
openTokens--
if (!openTokens) {
return [firstMatch + str.slice(matchStartIndex, match.index) + match[0], code]
return [firstMatch + inside + match[0], code]
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions lib/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ describe('mos', () => {
})
})

// TODO: make this test pass
it.skip('should ignore closing tag that is inside a fenced block', () => {
it('should ignore closing tag that is inside a fenced block', () => {
const renderMD = mdRenderer({
package: {
name: 'foo',
Expand Down

0 comments on commit 3566bc0

Please sign in to comment.