Aram created this task.
Aram added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  **Steps to replicate**:
  
  - Run `noreferences.py` on a page with footer templates directly under the 
references heading.
  - Diff: https://ckb.wikipedia.org/w/index.php?diff=prev&oldid=1581970
  
  **What happens?**:
  The script matches and skips portal/footer templates (like `{{portal bar}}`, 
`{{commons category}}` and/or navigation templates) immediately under the 
heading because the `templates_or_comments` regex matches all templates. This 
pushes `{{reflist}}` to the bottom of the section, below those templates.
  
  **What should happen?**:
  The references list should be placed immediately under the heading (skipping 
HTML comments). **Why was the original regex designed to match and skip 
templates in a references section?**
  
  **Software version**: 11.3.0
  
  **Proposed Suggestion**:
  Modify the regex to only match and skip HTML comments instead of templates:
  
    - templates_or_comments = re.compile(
    -     r'^((?:\s*(?:\{\{[^\{\}]*?\}\}|<!--.*?-->))*)',
    + comments = re.compile(
    +     r'^((?:\s*(?:<!--.*?-->))*)',

TASK DETAIL
  https://phabricator.wikimedia.org/T426895

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to