summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2018-11-24 17:35:53 +0100
committerGitHub2018-11-24 17:35:53 +0100
commit4856aa2840fb60f1dda59e164fe4937e93d4b312 (patch)
treefa5ae912156aeeebe64cbe115806b1b5d00e4537 /public/js
parent6d0c3ccd23e445a31bd6aa5fd8639479f98a5699 (diff)
parent33774c11b989a6a8aa2517e1a83d39c43741fc90 (diff)
Merge pull request #1069 from SISheogorath/fix/to-markdown
Update from to-markdown to turndown
Diffstat (limited to '')
-rw-r--r--public/js/index.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/public/js/index.js b/public/js/index.js
index c2969e92..a845b5d3 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -12,7 +12,7 @@ require('../css/site.css')
require('highlight.js/styles/github-gist.css')
-import toMarkdown from 'to-markdown'
+import TurndownService from 'turndown'
import { saveAs } from 'file-saver'
import randomColor from 'randomcolor'
@@ -1498,7 +1498,12 @@ $('#snippetExportModalConfirm').click(function () {
})
function parseToEditor (data) {
- var parsed = toMarkdown(data)
+ var turndownService = new TurndownService({
+ defaultReplacement: function (innerHTML, node) {
+ return node.isBlock ? '\n\n' + node.outerHTML + '\n\n' : node.outerHTML
+ }
+ })
+ var parsed = turndownService.turndown(data)
if (parsed) { replaceAll(parsed) }
}