mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Init markdown lib only when it's needed when posting a note to blog
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user