toHtml method
Convert markdown to html
Implementation
@override
String toHtml(String text) {
var match = exp.firstMatch(text.trim());
double? height;
double? width;
if (match?[1] != null) {
var size = RegExp(r"^([0-9]+)?x?([0-9]+)?")
.firstMatch(match![1].toString().trim());
width = double.tryParse(size?[1]?.toString().trim() ?? 'a');
height = double.tryParse(size?[2]?.toString().trim() ?? 'a');
}
return '<img src="${match?[2].toString().trim()}" height="$height" width="$width">';
}