Module talk:Diff

UString library required?

{{StringDiff|File:Branislav Sušnik.jpg|File:Janko Gregorič}}

File:Branislav Sušnik.jpg
+
File:Janko Gregorič

-- Rillke(q?) 11:21, 7 August 2013 (UTC)

Thank you. -- Rillke(q?) 14:06, 7 August 2013 (UTC)
Very sorry, didn't see your comment. But it is fixed, thanks for reporting it :) Also it is possible to remove inline styles by adding this somewhere on common.js:
mw.loader.load('mediawiki.action.history.diff');
After that custom styles related to <ins> and <del> can be removed also! :) −ebraminiotalk 18:41, 7 August 2013 (UTC)
But that is not probably a good solution because it takes long it be loaded but <ins> and <del> styles can be removed now! −ebraminiotalk 19:19, 7 August 2013 (UTC)
I don't know why Extension:Wikidiff2 code on an actually working repo ($wgExternalDiffEngine = 'wikidiff2';) does not use <ins> and <del> (in my VirtualBox, the default MW does!) but I think we should keep them because they are symantically correct. C.f. bugzilla:6844, mw:Special:Code/MediaWiki/19742, . Feel free to comment on bugzilla:52616.
As for the styling issue, when we have gerrit:75506 (live with 1.22wmf13), we can create a top-loader gadget so this will be loaded before the browser starts rendering anything. -- Rillke(q?) 20:53, 7 August 2013 (UTC)
Oh, I reverted to semantic tags. I've found another solution, adding
@import url('//bits.wikimedia.org/commons.wikimedia.org/load.php?debug=false&lang=en&modules=mediawiki.action.history.diff&only=styles&skin=vector&*');
to Common.css. Tested on my user CSS it seems is far better than JS solution so I think it worth to be tested. Of-course using a top-loader gadgets resourceloader would be far better than this (for me specially for this reason) but I think until deployment of wmf13 we can use this method. −ebraminiotalk 21:43, 7 August 2013 (UTC)
I fear, I am not brave enough adding this on the top of our MediaWiki:Common.css. Also the following would be sufficient (as there are several defaults):
@import url('//bits.wikimedia.org/commons.wikimedia.org/load.php?modules=mediawiki.action.history.diff&only=styles');
I started a discussion; so let’s see what other user’s opinion is about this matter. Perhaps, inline-styles are really the best solution as long as this is not that widely used. td.diff-marker will not be flipped in RTL (and will possibly override the default diff style o_o)… -- Rillke(q?) 23:07, 7 August 2013 (UTC)
Hmm. Didn't think about that, you are right. So I am going to make it more similar to wiki diff with inline styles. Thanks −ebraminiotalk 23:21, 7 August 2013 (UTC)
The mediawiki.action.history.diff module got renamed, now you need to write
mw.loader.load('mediawiki.diff.styles');
to MediaWiki:Common.js as a simple (but not so efficient) alternative to using the TemplateStyles extension. Holybiber (talk) 19:50, 13 May 2022 (UTC)

Escaping wikitext

I made a couple tweaks to this module so that you can diff wikitext and get the same results as one of MediaWiki's diffs. It also makes it possible to wrap both parameters to {{TextDiff}} or {{StringDiff}} in <nowiki>. This is one of the rare situations that warrant use of mw.text.unstrip(): I don't think it ever makes sense to diff two strip marker hashes.  Minh Nguyễn (talk, contribs) 07:56, 17 October 2013 (UTC)

CSS warning

This module is excellent. I noticed a CSS warning in the styles.css page though, in relation to "text-align: end;" Jonathan3 (talk) 19:24, 1 May 2021 (UTC)

CSS warnings are normal; this is how CSS works. Some browsers support text-align:end, others don’t and ignore it while showing warnings (although all modern browsers do support it—I don’t consider Internet Explorer modern in any way). —Tacsipacsi (talk) 21:17, 1 May 2021 (UTC)
Category:Pages using deprecated source tags