forked from eatvio/eatvio_app
chore: enhance markdown processing and UI adjustments in comments input
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user