In a file with windows line endings (CR; + LF;) a macro declaration that is followed by a blank line will have a line ending included in its expansion. Saving the file with single-char line endings "fixes" the expansion, as does removing blank lines between/after macro declarations.
Important note: This is only reproducible when the macros are in a separate .ddoc file.
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/35735aaf062e4f11c0d6418169e0d72422d34673 Fix Issue 13212 - Windows line endings handled incorrectly by ddoc macros Handle \r as \n in macro definitions to prevent a trailing carriage return on a macro with an empty line following it. https://github.com/D-Programming-Language/dmd/commit/a3a1ef0bf134b00e37875cff2508510a82974530 Merge pull request #3829 from ntrel/macro-cr Fix Issue 13212 - Trailing Windows line endings not stripped from .ddoc macros