Merge pull request #1069 from SISheogorath/fix/to-markdown
Update from to-markdown to turndown
This commit is contained in:
commit
4856aa2840
2 changed files with 8 additions and 3 deletions
|
@ -122,8 +122,8 @@
|
|||
"store": "^2.0.12",
|
||||
"string": "^3.3.3",
|
||||
"tedious": "^1.14.0",
|
||||
"to-markdown": "^3.0.3",
|
||||
"toobusy-js": "^0.5.1",
|
||||
"turndown": "^5.0.1",
|
||||
"uuid": "^3.1.0",
|
||||
"validator": "^10.4.0",
|
||||
"velocity-animate": "^1.4.0",
|
||||
|
|
|
@ -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) }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue