Add array overload

This commit is contained in:
Ryan Cavanaugh
2018-05-29 21:56:53 -07:00
parent 348d75dac9
commit 8148b63692
2 changed files with 6 additions and 0 deletions

View File

@@ -321,6 +321,7 @@ declare namespace Showdown {
* @param name
*/
addExtension(extension: ShowdownExtension, name: string): void;
addExtension(extension: ShowdownExtension[], name: string): void;
/**
* Use a global registered extension with THIS converter

View File

@@ -17,6 +17,11 @@ var preloadedExtensions = [ 'my-ext' ],
var configuredConverter = new showdown.Converter();
configuredConverter.addExtension({type: 'output', filter: (text, converter)=>{return text.replace('#', '*')}}, 'myext');
configuredConverter.addExtension([
{type: 'output', filter: (text, converter)=>{return text.replace('#', '*')}},
{type: 'output', filter: (text, converter)=>{return text.replace('#', '*')}}
], 'myext');
console.log(showdown.helper);
console.log(converter.makeHtml(exampleMarkdown));