It's mostly about extracting what MacroContentParser already do but in a more reusable location. It's not a perfect conversion, but it covers most use cases designed to be inline. It could be improved later to convert some standalone block to completely different ones that works inline (line expressing a list in an inline way, etc).
XWIKI-19209 Add support for inline execution of UI extensions
XRENDERING-658 Removing the top level paragraph when it has no children fails