Skip to content

Commit

Permalink
fix(output modifiers): fix for output modifiers running twice
Browse files Browse the repository at this point in the history
Output modifiers were being ran twice. This commit fixes that
  • Loading branch information
tivie committed Jun 7, 2015
2 parents 4ebd0ca + db46922 commit dcbdc61
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dist/showdown.js.map

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions test/node/showdown.Converter.makeHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ describe('showdown.Converter', function () {
.filter(filter())
.map(map('test/issues/'));

describe('Converter.options extensions', function () {
showdown.extensions.testext = function () {
return [{
type: 'output',
filter: function (text) {
runCount = runCount + 1;
return text;
}
}];
};
var runCount,
converter = new showdown.Converter({extensions: ['testext']});

it('output extensions should run once', function () {
runCount = 0;
converter.makeHtml('# testext');
runCount.should.equal(1);
});
});

function filter() {
return function (file) {
var ext = file.slice(-3);
Expand Down

0 comments on commit dcbdc61

Please sign in to comment.