applyToDocument method
Apply this ruleset to the given document and return the result.
Implementation
Document applyToDocument(Document document, {bool clearPrevious = true}) {
return Document(
document.paragraphs.map(
(p) => p.match(
line: (l) {
return l.copyWith(
spans: applyToString(l.spannedText, clearPrevious: clearPrevious),
);
},
embed: (e) => e,
),
),
);
}