Steps to replicate the issue (include links if applicable):
- Make a pre block with an indent, as such:
:<pre>
import pywikibot
site = pywikibot.Site("wikidata", "wikidata")
data = {"claims": []}
claim = pywikibot.Claim(site, "P31")
claim.setTarget(pywikibot.ItemPage(site, "Q5"))
data.append(claims.toJSON())
new_item = pywikibot.ItemPage(site)
new_item.editEntity(data, summary="Making new item...")
</pre>What happens?: The text renders in a single line outside of the <pre> tags. From Special:ExpandTemplates, this is rendered:
<div class="mw-parser-output"><dl><dd><pre></pre></dd></dl>
<p>import pywikibot
site = pywikibot.Site("wikidata", "wikidata")
data = {"claims": []}
claim = pywikibot.Claim(site, "P31")
claim.setTarget(pywikibot.ItemPage(site, "Q5"))
data.append(claims.toJSON())
new_item = pywikibot.ItemPage(site)
new_item.editEntity(data, summary="Making new item...")
</p>
</div>What should have happened instead?: The code should be inside the <pre> tag.
Software version (skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.): The VisualEditor is able to correctly render it for some reason.