Merge pull request #26136 from RyanCavanaugh/showdownexts

Add array overload to showdown
This commit is contained in:
Benjamin Lichtman
2018-05-31 09:47:19 -07:00
committed by GitHub
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));