File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/components/NcRichText Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ import { remarkPlaceholder, prepareTextNode } from './placeholder.js'
7373
7474import { unified } from ' unified'
7575import markdown from ' remark-parse'
76+ import markdownGithub from ' remark-gfm'
7677import breaks from ' remark-breaks'
7778import remark2rehype from ' remark-rehype'
7879import rehype2react from ' rehype-react'
@@ -172,6 +173,7 @@ export default {
172173 renderMarkdown (h ) {
173174 const renderedMarkdown = unified ()
174175 .use (markdown)
176+ .use (this .autolink ? markdownGithub : null )
175177 .use (remarkAutolink, {
176178 autolink: this .autolink ,
177179 useMarkdown: this .useMarkdown ,
@@ -217,7 +219,9 @@ export default {
217219 },
218220 prefix: false ,
219221 })
220- .processSync (this .text )
222+ .processSync (this .text .slice ().replace (/ \n {2,} / g , (match ) => {
223+ return ' \n\u00A0 ' .repeat (match .length - 1 ) + ' \n '
224+ }))
221225 .result
222226
223227 return h (' div' , { class: ' rich-text--wrapper' }, [
You can’t perform that action at this time.
0 commit comments