Explorar o código

富文本部分换行问题

zq hai 3 días
pai
achega
6fd14fe956
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      src/components/PinyinText.vue

+ 6 - 1
src/components/PinyinText.vue

@@ -335,7 +335,12 @@ export default {
         } else if (item.text && typeof item.text === 'string' && item.text.includes('<audio')) {
           blocks.push(this.parseAudioBlock(item, tagStack));
         } else if (item.is_style === 'true' || item.is_style === true) {
-          this.handleStyleTag(item, tagStack);
+          if (item.text.includes('<br')) {
+            blocks.push({ type: 'newline' });
+            paragraphIndex += 1;
+          } else {
+            this.handleStyleTag(item, tagStack);
+          }
         } else if (item.text === '\n') {
           blocks.push({ type: 'newline' });
           paragraphIndex += 1;