Ver código fonte

Use marked api without callback

simov 8 anos atrás
pai
commit
31789c0eb0
1 arquivos alterados com 2 adições e 5 exclusões
  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})
     })
   }
 }