md阅读器+

This commit is contained in:
DelLevin-Home
2026-05-22 15:27:39 +08:00
parent 6b5488aff8
commit 79f813c463
11 changed files with 1879 additions and 1414 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -99,9 +99,9 @@ class _NoteListItemContent extends StatelessWidget {
],
// 内容摘要去除Markdown标记内容为空则不显示
if (_cleanMarkdown(note.content).trim().isNotEmpty)
if (_collapseBlankLines(_cleanMarkdown(note.content).trim()).isNotEmpty)
Text(
_cleanMarkdown(note.content).trim(),
_collapseBlankLines(_cleanMarkdown(note.content).trim()),
style: const TextStyle(
fontSize: 13,
color: Color(0xFF666666),
@@ -205,6 +205,11 @@ class _NoteListItemContent extends StatelessWidget {
.trim();
}
/// 合并连续空行为单行
String _collapseBlankLines(String text) {
return text.replaceAll(RegExp(r'\n\s*\n+'), '\n');
}
/// 显示删除确认对话框
void _showDeleteDialog(BuildContext context) {
showDialog(