Skip to content

Commit 392558f

Browse files
committed
fix(html): fix parsing date time in post floor
1 parent 6a8bf54 commit 392558f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/extensions/universal_html.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,13 @@ extension GrepExtension on Element {
308308
}
309309

310310
if (nodes.firstOrNull?.nodeType == Node.TEXT_NODE) {
311+
final childText = nodes.first.text ?? '';
312+
if (childText.startsWith('发表于')) {
313+
// Use case: post publish time in post floor.
314+
// 发表于 $time
315+
return childText.replaceAll('发表于', '').trim().parseToDateTimeUtc8();
316+
}
317+
311318
return nodes.first.text?.trim().parseToDateTimeUtc8();
312319
}
313320

0 commit comments

Comments
 (0)