Working on this task requires knowledge of regular expressions in PHP.
Currently, the applyDiffStyle() function uses the regex
to try to detect the CSS classes.
This only works if the element has only one class and fails for some classes (mentioned on T36800) which appear at
would be slightly better:
but still wouldn't work in case there is some class before the specified class:
Besides, notice that
has only one backslash and
has two. I don't know what is the proper syntax for this in PHP strings but it is likely that one of the two needs to be fixed.
A patch exists in Wikimedia Gerrit which needs to be reworked.
- T36800: Keep classes such as "diff-addedline" and "diff-deletedline" on diffs on RSS feeds
- T36798: Diffs on recent changes RSS/Atom feeds should have the same formatting of the on wiki diffs