Skip to content
Snippets Groups Projects
Commit 7378c4a9 authored by syuilo's avatar syuilo
Browse files

fix #7444

parent 89e7ef36
No related branches found
No related tags found
No related merge requests found
......@@ -58,10 +58,13 @@ export default defineComponent({
const text = token.props.text.replace(/(\r\n|\n|\r)/g, '\n');
if (!this.plain) {
const x = text.split('\n')
.map(t => t == '' ? [h('br')] : [t, h('br')]);
x[x.length - 1].pop();
return x;
const res = [];
for (const t of text.split('\n')) {
res.push(h('br'));
res.push(t);
}
res.shift();
return res;
} else {
return [text.replace(/\n/g, ' ')];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment