scanDocument
Scans a markdown document and returns a flat list of Spans with absolute document offsets for syntax highlighting.
Uses :markdown's pipeline:
Parse document to get link ref defs
Scan text into lexemes (with SourceRange)
Walk lines emitting block-level AND inline-level spans