engine/conversion/comparemarkers
module
Functions
compareMarkersForDowncast( __namedParameters, __namedParameters ) → numberinternalmodule:engine/conversion/comparemarkers~compareMarkersForDowncastSorts markers so the downcast result is deterministic regardless of the order markers were added to the marker collection.
The sort key is the marker's range, ordered "right-to-left" through the document so that a marker's opening boundary is processed after any markers nested inside it. This way the outer marker wraps the inner ones at conversion time.
Cases (positions shown as
0123456789, sort result top-to-bottom):Non-overlapping ranges — sorted by position, last range first:
Copy codea: [--] → c, b, a b: [--] c: [--]Adjacent ranges (end === start) — treated as non-overlapping:
Copy codefirst: [---] → third, second, first second: [---] third: [---]Nested ranges (same start, different ends) — inner first, outer last:
Copy codeshorter: [-] → shorter, longer longer: [---]Partially overlapping ranges — sorted by start position:
Copy codeearlier: [---] → later, earlier later: [---]Identical ranges — fall back to reverse name comparison:
Copy codealpha: [---] → charlie, bravo, alpha bravo: [---] charlie: [---]
Parameters
__namedParameters: readonly [ string, ModelRange ]__namedParameters: readonly [ string, ModelRange ]
Returns
number