Skip to content

Commit 8ea4a5f

Browse files
feat: reflect color and justing changes
1 parent 846d7c8 commit 8ea4a5f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

lib/utils/convert_html.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,21 @@ extension IsLinkTag on html.Element {
2121
bool get hasTextAlign {
2222
return outerHtml.contains("text-align");
2323
}
24+
25+
bool get hasUnderline {
26+
return outerHtml.contains("text-decoration: underline");
27+
}
2428
}
2529

2630
extension CustomHtmlStylesX on BuildContext {
2731
Map<String, String>? customStylesBuilder(html.Element element) {
2832
return {
29-
if (!element.hasTextAlign) "text-align": "justify",
33+
if (!element.hasTextAlign) "text-align": "left",
3034
if (element.isH1) "font-size": "20px",
31-
if (element.isLink) "color": colorTheme.orangePomegranade.htmlFormat,
32-
"text-decoration-color": colorTheme.orangePomegranade.htmlFormat,
35+
if (element.isLink) "color": colorTheme.orangePomegranade.hexString,
36+
"text-decoration-color": colorTheme.orangePomegranade.hexString,
37+
if (element.hasUnderline)
38+
"text-decoration-color": colorTheme.blackMirage.hexString,
3339
};
3440
}
3541
}

0 commit comments

Comments
 (0)