@@ -0,0 +1,11 @@
+/**
+ * 纯文本多行展示:把历史 <br> 还原为换行,配合 white-space: pre-wrap 使用(勿再 v-html)
+ */
+export function plainMultilineText(text) {
+ if (text == null || text === '') {
+ return ''
+ }
+ return String(text)
+ .replace(/<br\s*\/?>/gi, '\n')
+ .replace(/\n+/g, '\n')
+}