Page MenuHomePhabricator

Diffs in RSS, Atom feeds missing stylesheet
Closed, ResolvedPublic

Description

Author: shantanuo

Description:
When I subscribe to the RSS feed of the difference page, the red color text in
comparing Differences Between Revisions does not appear in RED in the feed. It
displays in black and it is hard to know what has changed. Though on the webpage
it is very easy to check only the RED color text.


Version: unspecified
Severity: minor
OS: other

Details

Reference
bz1284

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:09 PM
bzimport set Reference to bz1284.
bzimport added a subscriber: Unknown Object (MLST).

pkchan+bug=mediawiki wrote:

patch to add default stylesheet to feed

Attempt to apply main.css of the default stylesheet to feed.

attachment Feed.php.diff.txt ignored as obsolete

pkchan+bug=mediawiki wrote:

Comment on attachment 1267
patch to add default stylesheet to feed

Sorry, submitted wrong patch.

pkchan+bug=mediawiki wrote:

Patch to apply default stylesheet to RSS feed

Attempt to apply default stylesheet to RSS feed by add a style element to
includes/Feed.php .

Attached:

How reliable is this?

Technically, <style> is only legal inside the <head> portion of an HTML document, so
this would apparently produce invalid HTML fragments.

More seriously, importing the entire offsite stylesheet in each post could be rather
disruptive for inline display of the feed in a web-based aggregator.

Tam wrote:

(In reply to comment #4)

How reliable is this?

RSS readers should have HTTP access (e.g. correct proxy settings). There are
cases it does not support @import - maybe it is better to use <link
rel="stylesheet">. Anyway, having some probabilty to work is better than always
failing.

Technically, <style> is only legal inside the <head> portion of an HTML

document, so

this would apparently produce invalid HTML fragments.

Agree, but probably many RSS clients support quirks-mode. Otherwise, we cannot
specify styles other than using the style attribute, since boh <style> and
<link> are valid only in <head>.

More seriously, importing the entire offsite stylesheet in each post could be

rather

disruptive for inline display of the feed in a web-based aggregator.

I am equally preferable to inlining the styles, but doing otherwise made it easy
to customize by choosing another default style. How do you feel like spining off
a css file specifically for diffs?

Created attachment 1331
Experimental XSL stylesheet to apply to diff HTML to inline styles

Just for "fun" I tried whipping up an XSLT stylesheet to apply the styles
inline. This is kind of ugly; hopefully there's a nicer way of doing it. PHP 5
includes an XSLT extension, but doesn't compile it in by default (sigh).

In CVS HEAD I just applied a nice simple regex hack in
SpecialRecentchanges.php, which is sufficient for the moment.

Attached: