diff --git a/lib/web/note/util.js b/lib/web/note/util.js index 556460958..6842eebcf 100644 --- a/lib/web/note/util.js +++ b/lib/web/note/util.js @@ -90,8 +90,13 @@ exports.newNote = async function (req, res, body) { exports.getPublishData = function (req, res, note, callback) { const body = note.content const extracted = models.Note.extractMeta(body) - const markdown = extracted.markdown + let markdown = extracted.markdown const meta = models.Note.parseMeta(extracted.meta) + // extractMeta() will remove the meta part from markdown, + // so we need to re-add the `breaks` option for proper rendering + if (typeof extracted.meta.breaks === 'boolean') { + markdown = '---\nbreaks: ' + extracted.meta.breaks + '\n---\n' + markdown + } const createtime = note.createdAt const updatetime = note.lastchangeAt let title = models.Note.decodeTitle(note.title) diff --git a/public/docs/release-notes.md b/public/docs/release-notes.md index baea12718..68b214e47 100644 --- a/public/docs/release-notes.md +++ b/public/docs/release-notes.md @@ -8,6 +8,7 @@ ### Bugfixes - Fix a crash when using LDAP authentication with custom search attributes (thanks to [@aboettger-tuhh](https://github.com/aboettger-tuhh) for reporting) - Fix crash caused by a long note history when the MySQL database is used +- Fix `breaks` option not being respected in the publish-view ## 1.9.4 2022-07-10