# Hacking Walking the whole thing a couple of times! It's ridonkā™„ First just an irregex pass to support including files. Then, lexes and parses it into an s-expressed AST: markdown->sxml* Then four times this: pre-post-order* or pre-post-order-splice* First to change images to links, then to get a list of references (also "lifting" explicit links in short paragraphs or list items at that stage, and flattening nested lists), then the reference links, and then other stuff. During that last pass, specific subsystems are walked/preprocessed specificially. Blockquotes and HTML elements. That last past ends up with a flat list of strings hopefully which is then printed out by a simple for-each pass, followed by printing out any remaining extracted links. So if you wanna hack, sussing out the right level to do the hack is probably the difficultest part! Hacking on the upstream lowdown egg is probably going to be one of your first steps. ## wrap-nls wrap-nls keeps track of what line type it last saw so it can more conditionally add NLs or not, or whether to keep those NLs quoted. That's why procedures should go through wrap-nls instead of doing their own NL-adding.