Showing
1 changed file
with
9 additions
and
10 deletions
| @@ -540,7 +540,7 @@ class OrderedList extends BlockMd { | @@ -540,7 +540,7 @@ class OrderedList extends BlockMd { | ||
| 540 | 540 | ||
| 541 | class HighlightedText extends InlineMd { | 541 | class HighlightedText extends InlineMd { |
| 542 | @override | 542 | @override |
| 543 | - RegExp get exp => RegExp(r"`.*?`"); | 543 | + RegExp get exp => RegExp(r"`(.+?)`"); |
| 544 | 544 | ||
| 545 | @override | 545 | @override |
| 546 | InlineSpan span( | 546 | InlineSpan span( |
| @@ -556,12 +556,13 @@ class HighlightedText extends InlineMd { | @@ -556,12 +556,13 @@ class HighlightedText extends InlineMd { | ||
| 556 | final Widget Function(BuildContext context, String name, String code)? | 556 | final Widget Function(BuildContext context, String name, String code)? |
| 557 | codeBuilder, | 557 | codeBuilder, |
| 558 | ) { | 558 | ) { |
| 559 | + var match = exp.firstMatch(text.trim()); | ||
| 559 | return TextSpan( | 560 | return TextSpan( |
| 560 | - text: text, | 561 | + text: match?[1], |
| 561 | style: style?.copyWith( | 562 | style: style?.copyWith( |
| 562 | fontWeight: FontWeight.bold, | 563 | fontWeight: FontWeight.bold, |
| 563 | background: Paint() | 564 | background: Paint() |
| 564 | - ..color = Theme.of(context).colorScheme.surfaceContainerHighest | 565 | + ..color = Theme.of(context).colorScheme.onInverseSurface |
| 565 | ..strokeCap = StrokeCap.round | 566 | ..strokeCap = StrokeCap.round |
| 566 | ..strokeJoin = StrokeJoin.round, | 567 | ..strokeJoin = StrokeJoin.round, |
| 567 | ) ?? | 568 | ) ?? |
| @@ -823,17 +824,14 @@ class SourceTag extends InlineMd { | @@ -823,17 +824,14 @@ class SourceTag extends InlineMd { | ||
| 823 | // baseline: TextBaseline.alphabetic, | 824 | // baseline: TextBaseline.alphabetic, |
| 824 | child: Padding( | 825 | child: Padding( |
| 825 | padding: const EdgeInsets.all(2), | 826 | padding: const EdgeInsets.all(2), |
| 826 | - child: Container( | 827 | + child: SizedBox( |
| 827 | width: 20, | 828 | width: 20, |
| 828 | height: 20, | 829 | height: 20, |
| 829 | - decoration: ShapeDecoration( | 830 | + child: Material( |
| 831 | + color: Theme.of(context).colorScheme.onInverseSurface, | ||
| 830 | shape: const OvalBorder(), | 832 | shape: const OvalBorder(), |
| 831 | - // color: Theme.of(context).colorScheme.onSurface, | ||
| 832 | - color: Theme.of(context).colorScheme.surfaceContainerHighest, | ||
| 833 | - // borderRadius: BorderRadius.circular(100), | ||
| 834 | - ), | ||
| 835 | child: FittedBox( | 833 | child: FittedBox( |
| 836 | - fit: BoxFit.contain, | 834 | + fit: BoxFit.scaleDown, |
| 837 | child: Text( | 835 | child: Text( |
| 838 | "${match?[1]}", | 836 | "${match?[1]}", |
| 839 | // style: (style ?? const TextStyle()).copyWith(), | 837 | // style: (style ?? const TextStyle()).copyWith(), |
| @@ -842,6 +840,7 @@ class SourceTag extends InlineMd { | @@ -842,6 +840,7 @@ class SourceTag extends InlineMd { | ||
| 842 | ), | 840 | ), |
| 843 | ), | 841 | ), |
| 844 | ), | 842 | ), |
| 843 | + ), | ||
| 845 | ); | 844 | ); |
| 846 | } | 845 | } |
| 847 | } | 846 | } |
-
Please register or login to post a comment