formatHtml function
Implementation
String formatHtml(String html) {
try {
final document = html_parser.parse(html);
final root = document.documentElement ?? document.body;
if (root == null) return html;
return formatElement(root, 0);
} catch (e) {
return html;
}
}