diff --git a/test/node/Container/testMakeHtml.js b/test/node/Container/testMakeHtml.js index 185a440..be479ee 100644 --- a/test/node/Container/testMakeHtml.js +++ b/test/node/Container/testMakeHtml.js @@ -45,6 +45,25 @@ }); }); + describe('Converter.options prefixHeaderId', function () { + var converter = new showdown.Converter(), + text = 'foo header'; + + it('should prefix header id with "section"', function () { + converter.setOption('prefixHeaderId', true); + var html = converter.makeHtml('# ' + text), + expectedHtml = '

' + text + '

'; + html.should.equal(expectedHtml); + }); + + it('should prefix header id with custom string', function () { + converter.setOption('prefixHeaderId', 'blabla'); + var html = converter.makeHtml('# ' + text), + expectedHtml = '

' + text + '

'; + html.should.equal(expectedHtml); + }); + }); + function filter() { return function (file) { var ext = file.slice(-3);