-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Closed as not planned
Closed as not planned
Copy link
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectcustomer: googleVarious Google teamsVarious Google teamsp: flutter_markdownflutter/packages flutter_markdownflutter/packages flutter_markdownpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Internal: b/291644799
else if (tag == 'li') {
if (_listIndents.isNotEmpty) {
if (element.children.length == 0) {
element.children.add(md.Text(''));
}
Widget bullet;
dynamic el = element.children[0];
if (el is md.Element && el.attributes['type'] == 'checkbox') {
bool val = el.attributes['checked'] != 'false';
bullet = _buildCheckbox(val);
} else {
bullet = _buildBullet(_listIndents.last);
}
// See flutter/flutter_markdown#147 and flutter/flutter_markdown#169
child = Row(
textBaseline: TextBaseline.alphabetic,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
width: styleSheet.listIndent,
child: bullet
),
Expanded(child: child)
],
);
}
}
This creates a SizedBox with the listIndent
for the width of the box, however if the font causes one of the numbers to be slightly larger than the allotted size, the period overflows to the next line.
If the numbered list ends up causing double digits, this can also cause an issue.
Finally, if the font is scaled on the system, this will end up looking very bad too.
Using a FittedBox around the bullet
widget would fix this so that at least the numbers and periods stay on one line and always fit in the given size, though it could look weird to have a much smaller number compared to the rest, when that happens. But I think it would still be better than the current behavior.
ksheremet and Kurogoma4D
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectcustomer: googleVarious Google teamsVarious Google teamsp: flutter_markdownflutter/packages flutter_markdownflutter/packages flutter_markdownpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team