[BUG] vertical-align not working in Html/SelectableHtml
Describe the bug:
vertical-align property doesn't work as expected.
HTML to reproduce the issue:
<span>3</span><span style="vertical-align: super">x</span><span>-27 = 0<sup>x</sup></span>
Html widget configuration:
Using clean Html or SelectableHtml.
Additional info:
I couldn't find the property vertical-align in the parser file: https://github.com/Sub6Resources/flutter_html/blob/9bf06629d18caff5ad1ec390bb9dcae6ec8119fa/lib/src/css_parser.dart#L10
I try to put it, like this, seems works fine in Html default constructor
case 'vertical-align':
style.verticalAlign =
ExpressionMapping.expressionToVerticalAlign(value.first);
break;
// ... //
static VerticalAlign expressionToVerticalAlign(css.Expression value) {
if (value is css.LiteralTerm) {
switch (value.text) {
case "sub":
return VerticalAlign.SUB;
case "super":
return VerticalAlign.SUPER;
}
}
return VerticalAlign.BASELINE;
}
but that doesn't work with the SelectableHtml constructor, throwing a exception in this cast: https://github.com/Sub6Resources/flutter_html/blob/9bf06629d18caff5ad1ec390bb9dcae6ec8119fa/lib/html_parser.dart#L334
i think its are related to https://github.com/flutter/flutter/issues/38474, since it is merged, it's a leftover? removing this cast, works fine in my test case.
A picture of a cute animal (not mandatory but encouraged)
Related #717.
What is the status on this?
Can someone provide instructions on what could be done to implement this?
Still in progress. The code provided in the initial comment should be sufficient for a pull request, if someone would like to open one. SelectableHtml is being removed in 3.0.0 anyways.