1
0
Эх сурвалжийг харах

Use marked api without callback

simov 8 жил өмнө
parent
commit
31789c0eb0
1 өөрчлөгдсөн 2 нэмэгдсэн , 5 устгасан
  1. 2 5
      background/marked.js

+ 2 - 5
background/marked.js

@@ -14,11 +14,8 @@ md.marked = {
   },
   compile: (markdown, sendResponse) => {
     chrome.storage.sync.get('marked', (res) => {
-      marked.setOptions(res.marked)
-      marked(markdown, (err, html) => {
-        if (err) throw err
-        sendResponse({message: 'html', html})
-      })
+      var html = marked(markdown, res.marked)
+      sendResponse({message: 'html', html})
     })
   }
 }