Template talk:Refname rules

If a name is quoted when defined, it must also be quoted for additional invocations (i.e. name="something" is not the same as name=something).
That does not seem right.

automatically adds quotes if they are missing, so they are the same. --  Gadget850talk 02:14, 16 September 2014 (UTC)


 * If that is the case, then I think this rule should be updated. From experience in editing, I know that name=something is the same as name="something", and vice versa.
 * I'd like to suggest rewording this rule as follows:


 * I think we could also consider just cutting this rule. It's kind of complicated, and editors will discover this by experience, like I did. It's not really a rule to warn against unexpected results or undefined behavior. – Margin1522 (talk) 02:15, 26 November 2014 (UTC)


 * That is a recent addition and I don't know the rationale. --  Gadget850talk 04:02, 26 November 2014 (UTC)


 * In that case, I think I'd like to change my suggestion to delete it, and just trust editors to figure out that optional means optional. But before doing anything I left a note on the Talk page of the editor who added it. He seems to know what he's doing, so maybe there is some rationale that we don't know about. – Margin1522 (talk) 06:13, 26 November 2014 (UTC)
 * AlanM1 has replied and says he's sure the quotes used to matter (I believe he's right about that), but now they don't, so we can go ahead and correct it. For now I think the simplest would be to just delete this rule and keep an eye on it in case it changes again. So I will go ahead and do that. – Margin1522 (talk) 03:57, 29 November 2014 (UTC)


 * All markup is parsed by before being rendered into HTML. Sanitizer cleans up markup, including adding missing quotes. Thus, it does not matter for refnames. --   Gadget850talk 14:05, 29 November 2014 (UTC)

Single-quote character works fine
A quick test today found that a reference name can use single-quote characters as well as double-quote. I will invoke the single-quoted name. I will also invoke the name defined with single quotes using double quotes. I don't see any point in documenting this - just don't say single quotes are to be used. Mixed quotes around the same name don't work. And invoking with no quotes where defined as single quotes also works (previous discussion says this works with references defined with double quotes). Other weird combinations may work, but I haven't tested as they're even more useless; for example, "name'" and 'name"' might be interpreted as if   and.

Best wishes, Pol098 (talk) 17:04, 10 June 2022 (UTC)
 * The rules are much the same as for HTML attributes. Delimiters are used to mark the start and end of the ref name, but are only mandatory when the ref name contains certain special characters, otherwise they are optional. When delimiters are used, they may be either the ASCII apostrophe (U+0027) or the ASCII double-quote (U+0022), but whichever type of delimiter is chosen for the start, the delimiter at the end must be the same type; and the name enclosed by them may not contain the same character, but may contain the other one. -- Red rose64 &#x1f339; (talk) 23:25, 10 June 2022 (UTC)

The advantage of consistency
Even if single quotes, double quotes, or no quotes render the same, they are very different when search the editing page. One has to search in several different ways to find all instances or one will miss some. -- Valjean (talk) ( PING me ) 17:02, 10 December 2023 (UTC)