markup: complete building the outer "document" lexical analyzer

Signed-off-by: Peter Williams <pwil3058@bigpond.net.au>