Page MenuHomePhabricator

Echo Notification stripped first character of section heading (an asterisk)
Closed, ResolvedPublic

Description

The section in question is w:ru:Википедия:Форум/Общий#*_или_:

The Echo/Notification message said the editor replied in the section или :

Screen Shot 2022-01-19 at 9.50.04 AM.png (456×1 px, 70 KB)

It should have said * или :

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

It looks like we're parsing the section title as wikitext (which results in a bullet list here), and then we remove all HTML markup, leaving just the text you see. The section titles in subscription notifications are plain text.

For other Echo notifications, e.g. mentions, the section title in the notification is actually wikitext, and should be parsed and then markup removed. But this case is also handled wrong there, with the asterisk treated as a bullet list. It should be parsed as if it wasn't at the start of a line.

Change 755820 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/Echo@master] Parse section titles in notifs as if they weren't at the start of line

https://gerrit.wikimedia.org/r/755820

Change 755822 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Don't try to parse section titles as wikitext in subscription notifs

https://gerrit.wikimedia.org/r/755822

I've been using the following section titles for testing locally:

== <nowiki><b>not bold</b></nowiki> ==

== Topic with template {{echo|hi}} ==

== Topic with <script>alert(1)</script> ==

== title with [[link]] test ==

== RFC 3 ==

== &apos;&apos; oh no &apos;&apos; ==

== ** oh no ** ==

== title [[file:logo.png|20px|huh]] ''with'' <sup>more</sup> formatting ==

Summary of the fixes, note the incorrect entries in the "Before" screenshots marked in red:

BeforeAfter
Subscriptions
image.png (2×3 px, 509 KB)
image.png (2×3 px, 492 KB)
Mentions
image.png (2×3 px, 558 KB)
image.png (2×3 px, 550 KB)

Change 755820 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] Parse section titles in notifs as if they weren't at the start of line

https://gerrit.wikimedia.org/r/755820

Change 755822 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Don't try to parse section titles as wikitext in subscription notifs

https://gerrit.wikimedia.org/r/755822