generated from dellevin/template
md阅读器+
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user