Skip to content

Commit c2be672

Browse files
committed
fix ol lists not always being correctly indented
1 parent 22f90a9 commit c2be672

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
## [1.0.3] - 16th Se 2021:
1+
## [1.0.4] - 21st Sep 2021:
2+
- Fix entries of ordered lists being incorrectly indented sometimes
3+
4+
## [1.0.3] - 16th Sep 2021:
25
- Fix `a` tags not properly obaying the `linkStyle`
36
- Slightly increase the padding to the left of `blockquote` tags
47

lib/text_parser.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,8 @@ class TextParser extends StatelessWidget {
768768
}
769769
final entries =
770770
_parseChildNodesList(context, nextContext, node.nodes, {'li'});
771+
final olWidth =
772+
fontSize * ((entry + entries.length).toString().length) * 0.6 + 5;
771773
return Column(
772774
crossAxisAlignment: CrossAxisAlignment.start,
773775
mainAxisSize: MainAxisSize.min,
@@ -779,10 +781,7 @@ class TextParser extends StatelessWidget {
779781
mainAxisSize: MainAxisSize.min,
780782
children: <Widget>[
781783
SizedBox(
782-
width: fontSize *
783-
((entry + entries.length).toString().length) *
784-
0.6 +
785-
5,
784+
width: olWidth,
786785
child: Text('${entry++}.', style: nextContext.textStyle),
787786
),
788787
Flexible(child: e),

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_matrix_html
22
description: A Flutter widget for rendering static matrix html tags as Flutter widgets. (Will render over 70 different html tags!)
3-
version: 1.0.3
3+
version: 1.0.4
44
homepage: https://github.com/Sorunome/flutter_matrix_html
55

66
environment:

0 commit comments

Comments
 (0)