> Step 2. > > This finishes off the new escape-sequence parser and puts it into > mandoc_escape (mandoc.c, mandoc.h), then makes it the underlying engine > for a2roffdeco (out.c) (requiring a tiny change to term.c and html.c for > bailing out on bad sequences) and roff_res (roff.c). > > Now all escape-sequences are being parsed with the same engine! This > logic was being repeated in THREE different places, earlier (mandoc.c > for validation, out.c for output, and roff.c for predefined escapes). > > I've run this over all manuals I know of without problems, but it can > really use a close look-over with border cases. > > The next step is to clean out the out.c code, completely removing enum > roffdeco (putting that logic into mandoc.c, perhaps). Step 2b. I rolled back the roff part: the search/replace of predefined strings must happen prior to escape processing. I'd also forgotten to include mdoc_validate.c in the patch.