diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index 2e31a5d7..d8632da6 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -21,7 +21,6 @@ import Markdown from '../../lib/markdown' const { remote } = require('electron') const { Menu, MenuItem, dialog } = remote const WP_POST_PATH = '/wp/v2/posts' -const markdown = new Markdown() function sortByCreatedAt (a, b) { return new Date(b.createdAt) - new Date(a.createdAt) @@ -710,6 +709,7 @@ class NoteList extends React.Component { authToken = `Bearer ${token}` } const contentToRender = firstNote.content.replace(`# ${firstNote.title}`, '') + const markdown = new Markdown() const data = { title: firstNote.title, content: markdown.render(contentToRender),