Rewritten to:
 - let open [code] trump inner markup
 - deal with nested [tags]
 - smell nicer