dvFillPageSlots function
html with each marked slot's text replaced by its entry in slots,
escaped. A slot slots does not name keeps its captured text.
Implementation
String dvFillPageSlots(String html, Map<String, String> slots) {
if (slots.isEmpty || !html.contains(dvPageSlotAttribute)) return html;
const HtmlEscape element = HtmlEscape(HtmlEscapeMode.element);
return html.replaceAllMapped(_dvPageSlot, (Match match) {
final String? value = slots[match.group(1)!];
if (value == null) return match.group(0)!;
return '<span $dvPageSlotAttribute="${match.group(1)}">${element.convert(value)}</span>';
});
}