transformNodeToHTMLString method
String
transformNodeToHTMLString(
- Node node, {
- required List<
HTMLNodeParser> encodeParsers,
override
Transform the node
to html string.
Implementation
@override
String transformNodeToHTMLString(
Node node, {
required List<HTMLNodeParser> encodeParsers,
}) {
assert(node.type == BulletedListBlockKeys.type);
final html = toHTMLString(
transformNodeToDomNodes(node, encodeParsers: encodeParsers),
);
const start = '<ul>';
const end = '</ul>';
if (node.previous?.type != BulletedListBlockKeys.type &&
node.next?.type != BulletedListBlockKeys.type) {
return '$start$html$end';
} else if (node.previous?.type != BulletedListBlockKeys.type) {
return '$start$html';
} else if (node.next?.type != BulletedListBlockKeys.type) {
return '$html$end';
} else {
return html;
}
}