Page MenuHomePhabricator

Keep classes such as "diff-addedline" and "diff-deletedline" on diffs on RSS feeds
Open, LowPublic

Description

Currently, the content of RSS feeds such as
https://pt.wikipedia.org/w/index.php?title=Special:RecentChanges&feed=rss&action=purge
includes the classes

  • diff
  • diff-contentalign-left
  • diff-marker
  • diff-content
  • diff-lineno
  • diff-empty
  • diffchange
  • diffchange-inline

On the other hand, the other classes which are present on the wiki pages are removed from RSS feeds, making it difficult for the users to customize the styling of these diffs if they want to do so.

The classes

  • diff
  • diff-otitle
  • diff-ntitle
  • diff-addedline
  • diff-deletedline
  • diff-context
  • diffchange

shouldn't be removed by function applyDiffStyle from
https://phabricator.wikimedia.org/diffusion/MW/browse/master/includes/FeedUtils.php;5b0c72bca5381a50429ae5ef0d876eb5c71ab741$242
The styles should just be copied to the elements, without removing the classes (see $text = preg_replace( "/(<[^>]+)class=(['\"])$class\\2([^>]*>)/", "\\1style=\"$style\"\\3", $text ); in that code).

Besides, the regex used to detect the classes doesn't match the "diff" and "diffchange" classes. I'll open T36801: Function applyDiffStyle uses regexes which do not detect CSS classes appropriately specifically about that.

See also T36798: Diffs on recent changes RSS/Atom feeds should have the same formatting of the on wiki diffs.

Details

Reference
bz34800

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:11 AM
bzimport set Reference to bz34800.
bzimport added a subscriber: Unknown Object (MLST).
He7d3r created this task.Feb 29 2012, 5:35 PM
He7d3r updated the task description. (Show Details)Mar 12 2015, 1:22 PM
He7d3r set Security to None.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 7 2016, 9:03 PM
He7d3r updated the task description. (Show Details)Jan 19 2016, 12:04 PM
Aklapper updated the task description. (Show Details)Dec 22 2016, 3:59 PM
Aklapper removed a subscriber: wikibugs-l-list.
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptDec 22 2016, 3:59 PM
Aklapper updated the task description. (Show Details)Dec 22 2016, 4:02 PM