applyFormatRules method
Applies heuristic rules to specified format operation based on current
state of Notus document
.
Implementation
Delta applyFormatRules(
NotusDocument document, int index, int length, NotusAttribute value) {
final delta = document.toDelta();
for (var rule in formatRules!) {
final result = rule.apply(delta, index, length, value);
if (result != null) return result..trim();
}
throw StateError('Failed to apply format heuristic rules: none applied.');
}