Help talk:Citation Style 1/Archive 34
![]() | This is an archive of past discussions about Help:Citation Style 1. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 30 | ← | Archive 32 | Archive 33 | Archive 34 | Archive 35 | Archive 36 | → | Archive 40 |
|ol= prefix
In its present incarnation, {{cite Q}}
is a meta-template using {{citation}}
. It uses parameter values obtained from wikdata. Wikidata holds OpenLibrary identifiers that begin with an 'OL' prefix. cs1|2 emits an error message when the value assigned to |ol=
has an 'OL' prefix. Because this situation is reminiscent of this discussion, I have modified the |ol=
error checking to quietly accept OL identifiers with the OL prefix. The appearance of the rendering has not changed:
Wikitext | {{cite book
|
---|---|
Live | Treasure Island. OL 7130221M. |
Sandbox | Treasure Island. OL 7130221M. |
—Trappist the monk (talk) 10:19, 28 May 2017 (UTC)
- Thank you for this. It is a good application of Postel's Law. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 14:24, 28 May 2017 (UTC)
- Thanks from me also. What's old is new again (link to previous discussion, September 2014). – Jonesey95 (talk) 14:35, 28 May 2017 (UTC)
single quote for an ASCII quote
As the Module talk:Citation/CS1/COinS seems to be moribund, I decided to post here.
It took me a hour or more to work out that this was the cause of a problem that I have, because I read Help:CS1 and could not see that it was an obvious feature (so I assumed it was some sort of hidden character in the string or a fault in my scripting):
* {{cite encyclopedia |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)]] <!-- |encyclopedia=A well known encyclopedia --> }}
- .
Works
* {{cite encyclopedia |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)]] |encyclopedia=A well known encyclopedia }}
- . A well known encyclopedia.
Does not work because the ’
has been replaced with '
The reason for this substitution is in Module:Citation/CS1/COinS line 177:
value = value:gsub ('<span class="nowrap" style="padding%-left:0%.1em;">'(s?)</span>', "'%1"); -- replace {{'}} or {{'s}} with simple apostrophe or apostrophe-s
What is the thinking behind this line? -- PBS (talk) 12:57, 25 May 2017 (UTC)
HO-hum it seems that is unlikely to be the line as ' is an ordinary ASCII single quote '
so presumably the conversion is elsewhere. -- PBS (talk) 13:13, 25 May 2017 (UTC)
- Line 177 in Module:Citation/CS1/COinS is not the problem. That line is looking for all of the styling that is transcluded when the
{{'}}
and{{'s}}
templates are part of a cs1|2 parameter value because we don't want all of that extraneous html and css in the metadata.
- The bug you found is in the function
kern_quotes()
in Module:Citation/CS1. There, the‘
and’
characters (U+2018 & U+2019) are replaced with simple typewriter quotes, perhaps a bit overzealously. I've tweaked the sandbox to limit that replacement so that only those curly quotes that are the first and last characters to the title are replaced:{{cite encyclopedia/new |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)]] |encyclopedia=A well known encyclopedia}}
- . A well known encyclopedia.
- Your example that 'worked', worked because the title is not rendered in quotes; it was instead rendered in italics. Kerning is only applied to titles that the cs1|2 templates wrap in quote marks.
- —Trappist the monk (talk) 13:55, 25 May 2017 (UTC)
When I was trying to understand the example, I was distracted by what I perceived as errors in writing the citation. Maybe the following would be less distracting:
* {{cite encyclopedia |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)| SPENSER (Edmond)]] |encyclopedia = Dictionnaire universel d'histoire et de géographie | last1 = Bouillet | first1 = Marie-Nicolas | last2 = Chassang | first2 = Alexis }}
- Bouillet, Marie-Nicolas; Chassang, Alexis. . Dictionnaire universel d'histoire et de géographie.
As in PBS's report, Wikisource can't find the article. Note that I intentionally changed the curly single quote (used as an apostrophe) to a straight quote in the encyclopedia parameter. Jc3s5h (talk) 14:35, 25 May 2017 (UTC)
- The problem is that it can not easily be solved with redirects on Wikisource because as with this book, the will be hundreds subpages under the main page for many Wikisource sources. See for example:
- This also affects links into sections within a page where, unlike Wikipedia, Wikisouce often uses
‘’ “”
so potentially we have a problem that to access a section on Wikisource an ASCII single quote's
would be needed in the section header even though the rest of the text uses’s
. -- PBS (talk) 16:40, 25 May 2017 (UTC)
- " I've tweaked .. those curly quotes that are the first and last characters to the title are replaced". Given that the links can be to sections this might not be sufficient as like this one s:1911 Encyclopædia Britannica/Great Rebellion#The "Crowning_Mercy" it is possible that a funny quotation mark may be at the end of a title string (or at least before a | or a ]]) — this particular example has been hacked to use strait double quotes in the anchor, but the text has a pair of
“”
. - This explains why a link using
{{cite EB1911}}
fails on trying to link to that section, but does link to the one immediately before it.- Encyclopædia Britannica (11th ed.). 1911.
- Encyclopædia Britannica (11th ed.). 1911.
- Encyclopædia Britannica (11th ed.). 1911.
- -- PBS (talk) 17:04, 25 May 2017 (UTC)
- " I've tweaked .. those curly quotes that are the first and last characters to the title are replaced". Given that the links can be to sections this might not be sufficient as like this one s:1911 Encyclopædia Britannica/Great Rebellion#The "Crowning_Mercy" it is possible that a funny quotation mark may be at the end of a title string (or at least before a | or a ]]) — this particular example has been hacked to use strait double quotes in the anchor, but the text has a pair of
First things first: the reason that your {{cite EB1911}}
example does not work has nothing to do with any kind of quotes. The link doesn't work because a space (or underscore) is missing from between 'Crowning' and 'Mercy'. If I rewrite that example as:
{{cite EB1911|short=x|wstitle=Great Rebellion#The "Crowning Mercy"}}
- Encyclopædia Britannica (11th ed.). 1911. .
the link works and takes me to the proper place in the wikisource text.
Now quotes and kerning. cs1|2 renders certain titles inside double quote marks. Sometimes titles, especially news article titles, contain single or double quote marks: Alien abduction survivor: 'They've got Elvis!'
Without kerning, the terminal quote mark in my example would be placed directly adjacent to the trailing double quote mark applied by the cs1|2 template; kerning inserts a small amount of space so that the two quote marks can be distinguished. When I originally wrote the kerning code, I deferred support for wikilinked title text that cs1|2 would render in quotes because, in general, there is relatively little need for linking to en.wiki articles about a chapter or news article (if there are any such articles). Of course that ignores interwiki links to WikiSource among others.
The problem with wikilinked quoted title text is that kern_quotes()
is looking for a single or double quote mark as the first and/or last character in the title text. With wikilinks, the wiki markup gets in the way and there are two forms of wikilink. For the time being, and until I noodle out an appropriate solution, for wikilinks like the first example below, In the second example, because there is a label, kern_quotes()
shall do nothing because there is no 'label' for that link.kern_quotes()
does insert the space to separate quote marks:
Wikitext | {{cite encyclopedia
|
---|---|
Live | . Encyclopædia Britannica. |
Sandbox | . Encyclopædia Britannica. |
Wikitext | {{cite encyclopedia
|
---|---|
Live | . Great Rebelion. Encyclopædia Britannica. |
Sandbox | . Great Rebelion. Encyclopædia Britannica. |
I have restored the curly quote replacement code because kerning shall not be applied to the link portion of a wikilink. The example above, uses curley quotes in the label part of the wikilink. The example below shows that even with the curley quote replacement code restored, the link to wikisource works:
Wikitext | {{cite encyclopedia
|
---|---|
Live | . A well known encyclopedia. |
Sandbox | . A well known encyclopedia. |
—Trappist the monk (talk) 17:15, 26 May 2017 (UTC)
- The sandbox version of the first "Crowning Mercy" example now has properly kerning.
- —Trappist the monk (talk) 19:39, 26 May 2017 (UTC)
Sorry for the mistake, and thanks for pointing it out. "kerning" is nice to have, however not having it is not a show stopper. How soon can the fix to access to "wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Index alphabétique - A" be available in production? -- PBS (talk) 12:25, 28 May 2017 (UTC)
- I have made an interim change to the live module that permits:
{{cite encyclopedia |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)]] |encyclopedia=A well known encyclopedia}}
- . A well known encyclopedia.
- Kerning in this live version is still broken.
- —Trappist the monk (talk) 13:38, 28 May 2017 (UTC)
- Thanks for the improvement. -- PBS (talk) 09:18, 29 May 2017 (UTC)