This commit is contained in:
syuilo
2018-02-23 02:06:35 +09:00
parent e0ffedca24
commit c686a10472
7 changed files with 127 additions and 34 deletions

View File

@ -33,7 +33,11 @@ export default Vue.component('mk-post-html', {
.replace(/(\r\n|\n|\r)/g, '\n');
if ((this as any).shouldBreak) {
return text.split('\n').map(t => [createElement('span', t), createElement('br')]);
if (text.indexOf('\n') != -1) {
return text.split('\n').map(t => [createElement('span', t), createElement('br')]);
} else {
return createElement('span', text);
}
} else {
return createElement('span', text.replace(/\n/g, ' '));
}