Edit messages like "MediaWiki:Namespacenotice-" plus namespace name
which is blank for main namespace, or like e.g. "User_talk"
* Adjust user login/creation form hooks to work with a captcha plugin
+* (bug 1284) Inline styles for diffs in Recent Changes RSS/Atom feeds
=== Caveats ===
} else {
// Diff output fine, clean up any illegal UTF-8
$diffText = UtfNormal::cleanUp( $diffText );
+ $diffText = rcApplyDiffStyle( $diffText );
}
wfProfileOut( "$fname-dodiff" );
} else {
return $completeText;
}
+/**
+ * Hacky application of diff styles for the feeds.
+ * Might be 'cleaner' to use DOM or XSLT or something,
+ * but *gack* it's a pain in the ass.
+ *
+ * @param string $text
+ * @return string
+ * @access private
+ */
+function rcApplyDiffStyle( $text ) {
+ $styles = array(
+ 'diff' => 'background-color: white;',
+ 'diff-otitle' => 'background-color: white;',
+ 'diff-ntitle' => 'background-color: white;',
+ 'diff-addedline' => 'background: #cfc; font-size: smaller;',
+ 'diff-deletedline' => 'background: #ffa; font-size: smaller;',
+ 'diff-context' => 'background: #eee; font-size: smaller;',
+ 'diffchange' => 'color: red; font-wieght: bold;',
+ );
+
+ foreach( $styles as $class => $style ) {
+ $text = preg_replace( "/(<[^>]+)class=(['\"])$class\\2([^>]*>)/",
+ "\\1style=\"$style\"\\3", $text );
+ }
+
+ return $text;
+}
+
?>