File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 122122 "store" : " ^2.0.12" ,
123123 "string" : " ^3.3.3" ,
124124 "tedious" : " ^1.14.0" ,
125- "to-markdown" : " ^3.0.3" ,
126125 "toobusy-js" : " ^0.5.1" ,
126+ "turndown" : " ^5.0.1" ,
127127 "uuid" : " ^3.1.0" ,
128128 "validator" : " ^10.4.0" ,
129129 "velocity-animate" : " ^1.4.0" ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ require('../css/site.css')
1212
1313require ( 'highlight.js/styles/github-gist.css' )
1414
15- import toMarkdown from 'to-markdown '
15+ import TurndownService from 'turndown '
1616
1717import { saveAs } from 'file-saver'
1818import randomColor from 'randomcolor'
@@ -1498,7 +1498,12 @@ $('#snippetExportModalConfirm').click(function () {
14981498} )
14991499
15001500function parseToEditor ( data ) {
1501- var parsed = toMarkdown ( data )
1501+ var turndownService = new TurndownService ( {
1502+ defaultReplacement : function ( innerHTML , node ) {
1503+ return node . isBlock ? '\n\n' + node . outerHTML + '\n\n' : node . outerHTML
1504+ }
1505+ } )
1506+ var parsed = turndownService . turndown ( data )
15021507 if ( parsed ) { replaceAll ( parsed ) }
15031508}
15041509
You can’t perform that action at this time.
0 commit comments