From d195535ca058add1adce918c56235b1ca5caf454 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Mon, 17 Jun 2019 14:41:57 +0200 Subject: [PATCH] fix(core): update --- package-lock.json | 5 +++++ package.json | 3 ++- ts/index.ts | 1 + ts/smartmarkdown.plugins.ts | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index a723183..9ed51c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2129,6 +2129,11 @@ "jsdom": "^11.9.0" } }, + "turndown-plugin-gfm": { + "version": "1.0.2", + "resolved": "https://verdaccio.lossless.one/turndown-plugin-gfm/-/turndown-plugin-gfm-1.0.2.tgz", + "integrity": "sha512-vwz9tfvF7XN/jE0dGoBei3FXWuvll78ohzCZQuOb+ZjWrs3a0XhQVomJEb2Qh4VHTPNRO4GPZh0V7VRbiWwkRg==" + }, "tweetnacl": { "version": "0.14.5", "resolved": "https://verdaccio.lossless.one/tweetnacl/-/tweetnacl-0.14.5.tgz", diff --git a/package.json b/package.json index 2f50a43..066ca8b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "@types/marked": "^0.6.5", "@types/turndown": "^5.0.0", "marked": "^0.6.2", - "turndown": "^5.0.3" + "turndown": "^5.0.3", + "turndown-plugin-gfm": "^1.0.2" }, "files": [ "ts/*", diff --git a/ts/index.ts b/ts/index.ts index 12b21d7..ba933eb 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -16,6 +16,7 @@ export class SmartMarkdown { headingStyle: 'atx', codeBlockStyle: 'fenced' }); + turndownInstance.use(plugins.turndownPluginGfm.gfm); return turndownInstance.turndown(htmlString); } } diff --git a/ts/smartmarkdown.plugins.ts b/ts/smartmarkdown.plugins.ts index 3cd20f3..72f4c7b 100644 --- a/ts/smartmarkdown.plugins.ts +++ b/ts/smartmarkdown.plugins.ts @@ -1,4 +1,5 @@ import marked = require('marked'); import turndown from 'turndown'; +import * as turndownPluginGfm from 'turndown-plugin-gfm'; -export { marked, turndown }; +export { marked, turndown, turndownPluginGfm };