mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Merge pull request #1676 from lijinglue/hotfix/markdown-render-in-blog-post
hotfix: update markdown render in blog post feature
This commit is contained in:
@@ -15,11 +15,12 @@ import path from 'path'
|
|||||||
import { hashHistory } from 'react-router'
|
import { hashHistory } from 'react-router'
|
||||||
import copy from 'copy-to-clipboard'
|
import copy from 'copy-to-clipboard'
|
||||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
import markdown from '../../lib/markdown'
|
import Markdown from '../../lib/markdown'
|
||||||
|
|
||||||
const { remote } = require('electron')
|
const { remote } = require('electron')
|
||||||
const { Menu, MenuItem, dialog } = remote
|
const { Menu, MenuItem, dialog } = remote
|
||||||
const WP_POST_PATH = '/wp/v2/posts'
|
const WP_POST_PATH = '/wp/v2/posts'
|
||||||
|
const markdown = new Markdown()
|
||||||
|
|
||||||
function sortByCreatedAt (a, b) {
|
function sortByCreatedAt (a, b) {
|
||||||
return new Date(b.createdAt) - new Date(a.createdAt)
|
return new Date(b.createdAt) - new Date(a.createdAt)
|
||||||
@@ -708,7 +709,7 @@ class NoteList extends React.Component {
|
|||||||
authToken = `Bearer ${token}`
|
authToken = `Bearer ${token}`
|
||||||
}
|
}
|
||||||
const contentToRender = firstNote.content.replace(`# ${firstNote.title}`, '')
|
const contentToRender = firstNote.content.replace(`# ${firstNote.title}`, '')
|
||||||
var data = {
|
const data = {
|
||||||
title: firstNote.title,
|
title: firstNote.title,
|
||||||
content: markdown.render(contentToRender),
|
content: markdown.render(contentToRender),
|
||||||
status: 'publish'
|
status: 'publish'
|
||||||
|
|||||||
Reference in New Issue
Block a user