修复h5
This commit is contained in:
@@ -111,7 +111,20 @@ function clearSearch() {
|
||||
}
|
||||
|
||||
function preview(content) {
|
||||
const text = (content || '').replace(/<[^>]+>/g, '').replace(/ /g, ' ').replace(/\s+/g, ' ').trim()
|
||||
if (!content) return '暂无内容'
|
||||
let html = content
|
||||
.replace(/<\/t[dh]>/gi, ' ')
|
||||
.replace(/<\/tr>/gi, ' ')
|
||||
.replace(/<\/p>/gi, ' ')
|
||||
.replace(/<br\s*\/?>/gi, ' ')
|
||||
const text = html
|
||||
.replace(/<[^>]+>/g, '')
|
||||
.replace(/ /g, ' ')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim()
|
||||
if (!text) return '暂无内容'
|
||||
return text.length > 60 ? `${text.slice(0, 60)}...` : text
|
||||
}
|
||||
@@ -220,6 +233,7 @@ function onDelete(item) {
|
||||
@include card;
|
||||
padding: 28rpx 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
overflow: hidden;
|
||||
|
||||
&:active {
|
||||
opacity: 0.92;
|
||||
@@ -267,11 +281,18 @@ function onDelete(item) {
|
||||
}
|
||||
|
||||
.note-preview {
|
||||
display: block;
|
||||
display: -webkit-box;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
font-size: 26rpx;
|
||||
color: $color-text-secondary;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 20rpx;
|
||||
word-break: break-all;
|
||||
overflow-wrap: anywhere;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.note-actions {
|
||||
|
||||
Reference in New Issue
Block a user