For example, <ref name=2022>test</ref>
results in "Cite error: The <ref>
tag name cannot be a simple integer."
I don't mind this restriction, but I am just asking out of curiosity.
For example, <ref name=2022>test</ref>
results in "Cite error: The <ref>
tag name cannot be a simple integer."
I don't mind this restriction, but I am just asking out of curiosity.
The explanation looks something like "the object should be symbolic in nature, and not a number (in C programming, a symbol is like a string; a symbol does not begin with a number -- that would fool the parser into thinking the object being parsed is some kind of number)".
I believe this restriction comes from the HTML specification. If you want to use a number-like value as the name, you should quote it (which ideally you should do anyway), i.e. <ref name="2022">test</ref>
or similar.
Typically most (if not all) parsers make no distinction of strings and numbers in this context. ("everything is string" likely)
<ref name= a12345 >test</ref>
works perfectly well.
It "works" because people are lazy and write it without quotes, but, as I said, properly you should quote it.
It's not about the quotes. The original reason is that <ref>
tags without a name=…
are automatically named – with numbers. While there would be a way to allow both (e.g. by prepending two different prefixes) the original authors of this extension found it easier and less confusing for everybody to reserve numbers for internal use.
I hope this helps.