Issue 9497 - ddoc: add support for handling undefined macros

Fresh approach replacing https://github.com/D-Programming-Language/dmd/pull/1653
Because `$0` puts a comma between `$1` and `$2`, which we don't want.