Thomas Mortagne yes, I did end up with this syntax by asking the renderer to serialize a content with a newline at the end.
in ConfluenceXWikiGeneratorListener, which extends XHTMLXWikiGeneratorListener:
super.onMacroInline(CODE, params, code)
See also CONFLUENCE-398.
"Fixing" this would be a backward-incompatible change, as discussed.
We may want to handle this in a future version of the syntax.