From 97600e526b0188ef317195df65f7e60109fd320b Mon Sep 17 00:00:00 2001 From: lurong Date: Sat, 24 Feb 2018 02:51:01 +0800 Subject: [PATCH] remove the first occurrence of title in content when publishing to WP --- browser/main/NoteList/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index ff90404d..56101b63 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -687,9 +687,10 @@ class NoteList extends React.Component { } else { token = `Bearer ${token}` } + let contentToRender = firstNote.content.replace(`# ${firstNote.title}`, '') var data = { title: firstNote.title, - content: markdown.render(firstNote.content), + content: markdown.render(contentToRender), status: 'publish' }