Skip to content

Commit

Permalink
don't populate a first newline to properly parse blockqoute tags
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Aug 25, 2023
1 parent e03e6c8 commit 59b9c5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/NcRichText/NcRichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,10 @@ export default {
prefix: false,
})
.processSync(this.useMarkdown
// In order to correctly show newlines in Markdown,
// each newline contains a non-breaking space
? this.text.slice().replace(/\n{2,}/g, (match) => {
return '\n\u00A0'.repeat(match.length - 1) + '\n'
return '\n' + '\n\u00A0\n'.repeat(match.length - 1)
})
: this.text)
.result
Expand Down

0 comments on commit 59b9c5c

Please sign in to comment.