Wikipedia talk:COinS

Page contents not supported in other languages.
Source: Wikipedia, the free encyclopedia.

What to use instead of {{chem}} or <chem>?

I'm working through the references on Hydronium and finding several that contain things like {{chem|H|aq|+}} which produces "H+
"…which is not easily replicable using just <sub> and <sup>! However, the rubric on {{chem}} says that it should not be used in CS1/2 templates because it pollutes COinS. What is the recommended alternative? TIA HAND —Phil | Talk 18:08, 16 March 2017 (UTC)Reply[reply]

Alas, not much can be done unless there is a way of writing chemicals as plain text. It used to be that MediaWiki allowed Module:Citation/CS1/COinS to analyze the content of <chem>...</chem> tags so that it could write a text version into the metadata. A change to MediaWiki broke that functionality so the content of <chem>...</chem> tags is not available and renders in the metadata as something like ''?'"`UNIQ--chem-00000009-QINU`"'?'' which is meaningless to those who consume cs1|2 citations via the metadata. More on this in the cs1 archives – a discussion about Math ML, but quite related.
cs1|2 has never been, and probably will never be, able to render clean metadata for {{chem}} simply because that template produces so much html and css. For your example, the {{chem}} template output is:
<span class="chemf nowrap">H<span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1em;font-size:80%;text-align:left"><sup style="font-size:inherit;line-height:inherit;vertical-align:baseline">+</sup><br /><sub style="font-size:inherit;line-height:inherit;vertical-align:baseline">aq</sub></span></span>
Consumers of cs1|2 metadata are then left to decode that on their own.
Trappist the monk (talk) 10:53, 17 March 2017 (UTC)Reply[reply]
Is it impossible to simply strip out the HTML tags from that text (which I have taken the liberty of prettifying to emphasise the tags)? That would at least produce some kind of usable result. I would have thought that would be a fairly basic operation… —Phil | Talk 16:19, 17 March 2017 (UTC)Reply[reply]

the COINS warning: where not to use, exactly?

For examplwe {{Val}} has the COINS note saying "not in templates such as CS1". Could it be more specific? Does it include {{#tag:ref|...}}? -DePiep (talk) 10:16, 6 January 2022 (UTC)Reply[reply]

Format of COinS fields

From information available on Wikipedia it's unclear to me what data format is expected in COinS and therefore what counts as "polluting". At Fin field-effect transistor there is a CS1 citation with |title=Dual-V<sub>th</sub> Independent-Gate FinFETs for Low Power Logic Circuits. This produces rft.atitle=Dual-V%3Csub%3Eth%3C%2Fsub%3E+Independent-Gate+FinFETs+for+Low+Power+Logic+Circuits i.e. the HTML markup is preserved. Is this OK or not? Hairy Dude (talk) 22:15, 18 January 2023 (UTC)Reply[reply]