ソースを参照

富文本部分换行问题

zq 3 日 前
コミット
6fd14fe956
1 ファイル変更6 行追加1 行削除
  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;