From a32c2c909940b0f105d8094f44afaf18de482002 Mon Sep 17 00:00:00 2001 From: Jesse Donat Date: Tue, 11 Dec 2018 10:56:23 -0600 Subject: [PATCH 1/4] Adds makeMarkdown --- types/showdown/index.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/showdown/index.d.ts b/types/showdown/index.d.ts index 6e2b86cccc..1e3cff5774 100644 --- a/types/showdown/index.d.ts +++ b/types/showdown/index.d.ts @@ -294,6 +294,14 @@ declare namespace Showdown { */ makeHtml(text: string): string; + /** + * Converts an HTML string into a markdown string + * + * @param src + * @returns {string} + */ + makeMarkdown(src: string): string; + /** * Setting a "local" option only affects the specified Converter object. * From 6822f93313373eeca36d5bb1c13276be176abc70 Mon Sep 17 00:00:00 2001 From: Jesse Donat Date: Tue, 11 Dec 2018 10:56:49 -0600 Subject: [PATCH 2/4] Adds test --- types/showdown/showdown-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/showdown/showdown-tests.ts b/types/showdown/showdown-tests.ts index e31af905f7..0baf2f895f 100644 --- a/types/showdown/showdown-tests.ts +++ b/types/showdown/showdown-tests.ts @@ -6,6 +6,7 @@ import showdown = require('showdown'); var exampleMarkdown = '#hello, markdown', + exampleHTML = '

hello, markdown

', converter = new showdown.Converter(); var myExt: showdown.ShowdownExtension = { type: 'output', filter: (text, converter) => { return text.replace('#', '*') } }; @@ -34,6 +35,9 @@ console.log(configuredConverter.makeHtml(exampleMarkdown)); // should log '

*hello, markdown

' +console.log(converter.makeMarkdown(exampleHTML)); +// should log '#hello, markdown' + showdown.extension('myExt', function () { var matches: string[] = []; return [ From 7d2e44dab89402a2ac93cf365d1ee871f123fa7d Mon Sep 17 00:00:00 2001 From: Jesse Donat Date: Tue, 11 Dec 2018 11:31:35 -0600 Subject: [PATCH 3/4] Updates header version number --- types/showdown/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/showdown/index.d.ts b/types/showdown/index.d.ts index 1e3cff5774..4721b64c75 100644 --- a/types/showdown/index.d.ts +++ b/types/showdown/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Showdown 1.7.3 +// Type definitions for Showdown 1.9.0 // Project: https://github.com/coreyti/showdown // Definitions by: cbowdon , Pei-Tang Huang , Ariel-Saldana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 81d98691587719ca9f74cd99b8f2dbbbcb279f46 Mon Sep 17 00:00:00 2001 From: Jesse Donat Date: Tue, 11 Dec 2018 12:39:12 -0600 Subject: [PATCH 4/4] Update docs --- types/showdown/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/showdown/index.d.ts b/types/showdown/index.d.ts index 4721b64c75..21075fd6c7 100644 --- a/types/showdown/index.d.ts +++ b/types/showdown/index.d.ts @@ -297,8 +297,8 @@ declare namespace Showdown { /** * Converts an HTML string into a markdown string * - * @param src - * @returns {string} + * @param src The input text (HTML) + * @returns The output markdown */ makeMarkdown(src: string): string;