Module talk:Citation/CS1/Feature requests: Difference between revisions

Content deleted Content added
Suppress spurious warning about zero-width joiner: switch to hex so that people can easily look up the unicode values
Suppress spurious warning about zero-width joiner: suggest workaround and alternative solution
Line 304:
 
Another option, would be for you to check the language field and if it's set to one of the [[Brahmic scripts]], [[Indo-Aryan languages]], or [[Arabic script]]s to suppress the warnings about ZWJ and ZWNJ. --[[User:Marc Kupper|Marc Kupper]]|[[User talk:Marc Kupper|talk]] 00:47, 6 June 2016 (UTC)
 
: I thought of a work-around that does not involve changing the template. Instead, the title can be entered using [[HTML entities]]. Here's the {{tl|cite web}} used in the previous example but using the entities ത...‍ rather than UTF-8 as before.
:* {{cite web|title=തിരുവിതാംകൂര്‍|language=Malayalam}}
:Or, I can enter the title in UTF-8 except for the zero width joiner which I entered as an HTML entity.
:* {{cite web|title=തിരുവിതാംകൂര്‍|language=Malayalam}}
:There's no warning about the zero width joiner character though I did use one. The downsides are 1) people are used to copy/pasting UTF-8 strings and would need to convert them to HTML entities. 2) If the entire title is converted then it's no longer human readable when in edit-mode and is confusing to humans should just the zero-width joiners be entered as entities.
 
: Another way to code the template check which is to figure out the language blocks being used in a string. If they are in a language block that includes the use of characters such as the zero-width joiner then don't issue warnings when those characters are used. All 13 characters in the example title are in the [[Malayalam (Unicode block)]] which runs from U+0D00 to U+0D7F. This allows the code to detect and generate warnings should characters from two or more blocks be used in the same string. For example, we would not expect a Malayalam string to contain a character from the [[Cyrillic (Unicode block)]]. --[[User:Marc Kupper|Marc Kupper]]|[[User talk:Marc Kupper|talk]] 01:22, 8 June 2016 (UTC)