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
This bug may be specific to the "noinclude" code path
Indeed it is
The specific cause of this issue seems to arise from twinkleprotect.js#L1487 (and the code for other content models just above), in which the version with a <noinclude> tag doesn't have a \n automatically put at the end of its tag text.
I would say to just add a newline to keep the same behaviour with or without the noinclude text, but I'm not sure if that could screw up tagging on template pages, where bringing in a sudden newline at the top of the page could potentially break output (I don't personally use twinkle so I'm not sure how realistic of a scenario this is, or if the newline could even be problematic in most scenarios), so I won't be submitting a PR to add it myself for now
A good algorithm for the fix might be to just look for == at the top of the wikicode. If this is found, add a line break when doing the prepend.
NovemLinguae
changed the title
protect: when adding padlock icon, add a line break if next line is a heading (==)
protect: when adding padlock icon, add a line break if wikicode starts with a heading (==)
Oct 16, 2024
Reported by Star Mississippi at https://en.wikipedia.org/wiki/Wikipedia_talk:Twinkle#Protection_template_breaking_AfD
Bug: https://en.wikipedia.org/w/index.php?title=Wikipedia:Articles_for_deletion/Dilshad_Kamaludheen_(2nd_nomination)&diff=prev&oldid=1176550685
Fix: https://en.wikipedia.org/w/index.php?title=Wikipedia:Articles_for_deletion/Dilshad_Kamaludheen_(2nd_nomination)&diff=prev&oldid=1176561213
This bug may be specific to the "noinclude" code path
The text was updated successfully, but these errors were encountered: