소스 검색

Use marked api without callback

simov 8 년 전
부모
커밋
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})
     })
   }
 }