You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Adjustment to spaceBeforeSlash to add a spaceBeforeSlash only if the tag has attributes
Describe the solution you'd like
<namespace key="0" case="first-letter" /> // space before slash here (okay)
<text bytes="0" sha1="phoiac9h4m842xq45sp7s6u21eteeq1" xml:space="preserve" /> // space before slash here (okay)
<minor/> // do not add a space before slash here (not possible yet)
Describe alternatives you've considered
I can write my own post processing code to handle this, but I thought I'd mention it as a feature suggestion also.
Additional context
Asking in MediaWiki Discord server why in Wikipedia/MediaWiki XML exports, some tags have spaces before slash, and some don't, consensus was: "space before slash if the tag has attributes, otherwise no space"
I can't find any additional context to cite sources to further explain why I got this response, but I'm looking for further information. Actually, let me dig through the MediaWiki source code.
Note that this is compatibility for HTML, and not necessary otherwise
C.2. Empty Elements: "Include a space before the trailing / and > of empty elements, e.g. <br />, <hr /> and <img src="karen.jpg" alt="Karen" />. Also, use the minimized tag syntax for empty elements, e.g. <br />, as the alternative syntax <br></br> allowed by XML gives uncertain results in many existing user agents."
Note that rather than this ""feature"" idea being built in to the library, I whipped up this code to match what appears to be hard-coded inconsistency in MediaWiki Special:Export XML dumps (and as far as this point in time, I haven't found any further inconsistency than these two instances: "minor/sha1" tags):
Is your feature request related to a problem? Please describe.
Adjustment to spaceBeforeSlash to add a spaceBeforeSlash only if the tag has attributes
Describe the solution you'd like
Describe alternatives you've considered
I can write my own post processing code to handle this, but I thought I'd mention it as a feature suggestion also.
Additional context
"space before slash if the tag has attributes, otherwise no space"
Include a space before the trailing / and > of empty elements, e.g. <br />, <hr /> and <img src="karen.jpg" alt="Karen" />. Also, use the minimized tag syntax for empty elements, e.g. <br />, as the alternative syntax <br></br> allowed by XML gives uncertain results in many existing user agents.
"The text was updated successfully, but these errors were encountered: