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 set Security to None.

Six years later, is this still necessary?