mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(output modifiers): fix for output modifiers running twice
Output modifiers were being ran twice. This commit fixes that
This commit is contained in:
commit
dcbdc61e9d
BIN
dist/showdown.js.map
vendored
BIN
dist/showdown.js.map
vendored
Binary file not shown.
|
@ -17,6 +17,26 @@ describe('showdown.Converter', function () {
|
||||||
.filter(filter())
|
.filter(filter())
|
||||||
.map(map('test/issues/'));
|
.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() {
|
function filter() {
|
||||||
return function (file) {
|
return function (file) {
|
||||||
var ext = file.slice(-3);
|
var ext = file.slice(-3);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user