Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protect: when adding padlock icon, add a line break if wikicode starts with a heading (==) #1870

Open
NovemLinguae opened this issue Sep 22, 2023 · 2 comments · May be fixed by #2029
Open

Comments

@9382
Copy link
Contributor

9382 commented Nov 14, 2023

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

@NovemLinguae
Copy link
Member Author

NovemLinguae commented Oct 16, 2024

Reported again at https://en.wikipedia.org/wiki/Wikipedia_talk:Twinkle#Missing_line_break_when_protecting_AFD_page

I was able to reproduce on an AFD page

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 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
@TollensWP TollensWP linked a pull request Oct 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants