This commit is contained in:
2026-08-15 22:16:58 +08:00
parent a344aaedf3
commit aed71d237d
15 changed files with 13296 additions and 306 deletions
+23 -2
View File
@@ -111,7 +111,20 @@ function clearSearch() {
}
function preview(content) {
const text = (content || '').replace(/<[^>]+>/g, '').replace(/&nbsp;/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(/&nbsp;/g, ' ')
.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/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 {