chore: enhance markdown processing and UI adjustments in comments input

This commit is contained in:
mso7nueh
2026-01-12 16:31:22 +03:00
parent 497ff19cfa
commit a778257215
14 changed files with 516 additions and 266 deletions

View File

@@ -158,14 +158,22 @@ class _PlanWidgetState extends State<PlanWidget> {
}
}
details = result;
// Гарантируем, что жирный текст будет распознан
final boldRegex = RegExp(r'\*\*([^*]+)\*\*');
details = details.replaceAllMapped(boldRegex, (match) {
return '<b>${match.group(1)}</b>';
});
return Html(
data: md.markdownToHtml(
details.replaceAll('\n', '<br>'),
extensionSet: md.ExtensionSet.commonMark,
details,
extensionSet: md.ExtensionSet.gitHubFlavored,
),
style: {
"body": Style(margin: Margins.zero, padding: HtmlPaddings.zero, fontSize: FontSize(16), lineHeight: const LineHeight(1.5)),
"p": Style(margin: Margins.only(bottom: 12), color: appTheme.black),
"b, strong": Style(fontWeight: FontWeight.bold, color: appTheme.black),
"h1, h2, h3, h4, h5, h6": Style(margin: Margins.only(top: 16, bottom: 8), color: appTheme.black, fontWeight: FontWeight.bold),
"h1": Style(fontSize: FontSize(24)),
"h2": Style(fontSize: FontSize(20)),