Page MenuHomePhabricator

Fix cases of tags not being closed correctly
Open, MediumPublic

Description

Transformations like these need to take place:

  • <b /> to </b>
  • <div /> to </div>
  • </tag/> to </tag>

Special cases: empty <font /> or ‎<span /> (with no attributes) should be left alone when editing pages in namespaces like “Help”.

Tasks:

  • Add code to properly close the tags
  • Pass the name of the namespace of the page being edited to delint()
  • Modify existing tests to get them to pass (as the behavior of delint() would have changed)
  • Add new tests to ensure the newly added functionality is working properly

Relevant docs: https://www.mediawiki.org/wiki/Help:Lint_errors/self-closed-tag

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Fix self closing tagstoolforge-repos/delintbot!9kavaljeetsinghfix-self-closing-tagsmain
Customize query in GitLab

Event Timeline

Kavaljeet_Singh subscribed.

I am taking this task and start working

Redmin updated the task description. (Show Details)
Redmin moved this task from Triage to In Progress on the Tool-redminbot board.

Thanks, please let me know if you need help. The repository is at https://gitlab.wikimedia.org/toolforge-repos/redminbot/ (you will need a Wikimedia GitLab account to contribute).

@Kavaljeet_Singh, please do let me know if you want help with any part of the task.

@Redmin yes i am facing issue to use gitlab actually this is my first time to use gitlab please help -thanks

Can you please be a little more specific? Have you been able to clone the repository and make changes? If so, you need to create an account on Wikimedia GitLab. Then you can fork the repository and push your commit(s) to GitLab. Let me know if you get stuck anywhere. :)

I have cloned the repository and explored the codebase. It looks like page text processing is handled through the performreplacements() function in str_replacements.py which is used before editing pages in wikt.py
Should the self-closing tag fix be implemented inside performreplacements() or is there another place where this logic should go @Redmin?

Oh, sorry, I have moved the code for lint replacements to https://gitlab.wikimedia.org/toolforge-repos/delintbot in the meantime. The code should go in delinter.py (either inside the delint() function or outside). Apologies for the trouble caused.

Hi @Redmin,
I’ve implemented the fix for self closing tags along with namespace handling and ensured all tests pass.
Please let me know if any changes are needed. -thanks

Redmin changed the task status from Open to In Progress.Mar 17 2026, 3:45 PM
Redmin raised the priority of this task from Low to Medium.
Redmin added a project: Patch-For-Review.
Redmin changed the task status from In Progress to Open.Aug 25 2026, 3:27 AM