Template talk:Cite compare

Request to update the template to make code more visible
As seen on Help talk:Citation Style 1/Archive 7

currently produces:

Would it be possible to have the first box display the actual code (maybe with tags) to make it easier to see what code is contained in each parameter, such as this?

Thanks! GoingBatty (talk) 17:37, 5 January 2015 (UTC)


 * Partially. If the citation contains any templates, they are processed before  does it's thing.  For example, were I to use date in a comparison, you wouldn't see the template but rather the template's output:


 * You might get around that by doing this:


 * but, as you can see, that method presents its own set of problems.
 * —Trappist the monk (talk) 18:36, 5 January 2015 (UTC)
 * I don't think I worded my question properly. Would it be possible to change the cite compare template so that editors could use it exactly the same way, and the old/live/sandbox rows would output the same results, but the first row would output the exact code (as if it was wrapped in nowiki?  Thanks!  GoingBatty (talk) 02:18, 6 January 2015 (UTC)
 * I don't think I worded my question properly. Would it be possible to change the cite compare template so that editors could use it exactly the same way, and the old/live/sandbox rows would output the same results, but the first row would output the exact code (as if it was wrapped in nowiki?  Thanks!  GoingBatty (talk) 02:18, 6 January 2015 (UTC)


 * Draw me a picture because I can't tell the difference between this question and the original. In all of the the  templates on this page, do not the top rows show all of the 'unprocessed' code that an editor would write to get the rendered results in the lower rows? (excepting, as I noted, templates inside the  template which are processed before  is processed)


 * —Trappist the monk (talk) 02:39, 6 January 2015 (UTC)
 * Sorry - I could have sworn that the pages parameter was showing the links in the top rows instead of the unprocessed code. My bad.  Off to trout myself....  GoingBatty (talk) 03:43, 6 January 2015 (UTC)
 * Could we (i.e. not me) modify Module:PassArguments to have a "listnowiki" or similar option where the arguments were listed with "nowiki" wrappers around the values? – Jonesey95 (talk) 16:05, 6 December 2015 (UTC)

Add listnowiki option to /sandbox of Module:PassArguments
I added a "listnowiki" option to Module:PassArguments/sandbox and modified the cite/compare/sandbox to use it. It doesn't work, though, because I don't know how to program in Lua.

Anyone want to take a crack at it? – Jonesey95 (talk) 16:31, 6 December 2015 (UTC)

Please review my edit
I edited this template to get rid of lint errors of missing end tag (&lt;span>) and stripped tag (&lt;/span>). I encourage those with knowledge to verify that I didn't hurt anything. —Anomalocaris (talk) 08:33, 22 December 2017 (UTC)
 * I've removed the last tag (which replaced the  tag) and done some cleanup.  Initial white-space after the pipe in the   is ignored so the  tag, immediately following the pipe maintains subsequent newline whitespace so that   are the first characters on the line as required by the wiki table markup.
 * —Trappist the monk (talk) 10:52, 22 December 2017 (UTC)
 * Trappist the monk : Thank you. I did several checks, and your changes look good. FWIW, also has lint errors of missing end tag (&lt;span>) and stripped tag (&lt;/span>). This time I won't even try, since you or others have the skills to do this quickly. —Anomalocaris (talk) 21:16, 24 December 2017 (UTC)

span errors with separator=#
Based on lint errors at Help talk:Citation Style 1/Archive 6 and some experiments, it appears that # generates a spurious newline character in a, leading to a missing end tag for   and a stripped tag for. FWIW, ; does not do this. I have no idea what's going on and the separator parameter isn't documented, at least not where it's supposed to be documented. —Anomalocaris (talk) 05:06, 1 November 2019 (UTC)

new |template= parameter as alias of |mode=
I have tweaked this template so that its mode parameter is aliased with template. I did this so that the cs1|2 mode parameter can be used in the comparisons. For example, this does not work:

because two mode parameters, MediaWiki uses the right most and discards any other mode and, because and  do not exist, Module:Template wrapper vomits Lua errors: We can get round that by doing this:

—Trappist the monk (talk) 18:19, 10 April 2023 (UTC)