I'm applying the quick fix on stable-17.10.x (forcing the output syntax from the importmap template with ##!raw.syntax=html/5.0) and on master (18.8..0RC1) I added a new script service API to execute+render a UI extension in a specified output syntax, as per https://forum.xwiki.org/t/how-to-enforce-the-output-syntax-when-rendering-a-ui-extension/18818/2 .