Steps to replicate the issue (include links if applicable):
Testing this on the English Wikipedia. Make any action=parse request on the API with title set to a user talk page and text containing no talk sections, the issue appears. In this case, the following is used (see P32287 for full cURL output):
curl -v --url https://en.wikipedia.org/w/api.php --header "content-type: multipart/form-data" --form action=parse --form prop=text --form "title=User talk:Chlod" --form "text={{copied|from=A|to=B}}" --form format=json --form disablelimitreport=true
What happens?:
DiscussionTools emptystate banner shows up on output. The only way to disable this is by setting disableeditsection to true. Setting preview does not work. Here's the preview (without images, but the images do appear when the HTML is appended and CORS works):
What should have happened instead?:
The banner shouldn't be present on parsed HTML. I'm still unsure as to why something that's supposed to be part of the interface shows up on parsed HTML, especially when no specific wikitext triggers the banner. Setting disableeditsection feels like a hack, nothing explicitly triggered the banner so I should never expect it to appear. When attempting to render preview text (as seen above), this ends up polluting the output and causes a disparity with other wikis without DiscussionTools (despite using the same wikitext).