Template talk:'s

Latest comment: 8 years ago by Lordtobi in topic Strange

Delete? edit

As this is now unused (except in examples), should a request to delete this be submitted so that it doesn't get confused with the standard solution at {{'}}. At the very least, I think that this one should probably be marked with the {{tdeprecated}} tag. --- Barek (talkcontribs) - 16:49, 10 September 2008 (UTC)Reply

Comment: Over the past several months, this template has begun to get used in various articles ... so no point deprecating it now that it's in use again. --- Barek (talkcontribs) - 19:50, 29 January 2009 (UTC)Reply

Line break edit

I was surprised to see my browser insert a line break between an italicized ship name and this template. Shouldn't they keep together? This was at USS Indianapolis (CA-35), although obviously your browser is unlikely to break lines at the same place mine does. Kendall-K1 (talk) 04:48, 31 July 2015 (UTC)Reply

It's a useless, unnecessary template. For the reason you describe, I remove all instances of it when I encounter it and replace it with 's. By using HTML instead of the template, it also reduces processing overhead on the server. — QuicksilverT @ 14:55, 11 August 2015 (UTC)Reply
Thanks, will do. I see that Template:' has been fixed to keep with the previous text, but that doesn't seem to always work for me. Kendall-K1 (talk) 16:39, 11 August 2015 (UTC)Reply

‍ edit

The {{'}} template already contains ‍. Is there a reason that this template also begins with ‍?

{{'}} produces:
<span class="nowrap" style="padding-left:0.1em;">&#39;</span>
{{'s}} produces:
<span class="nowrap" style="padding-left:0.1em;">&#39;s</span>

Trappist the monk (talk) 14:53, 8 December 2015 (UTC)Reply

Strange edit

I just noticed this template for the first time because it was used in DYK. It renders really strange !!! Try saving the page and look at the HTML. It produces the following Unicode: e2 80 8d e2 80 8d e2 80 8a 27 e2 80 8b e2 80 8d 73. That is: ZERO WIDTH JOINER, ZERO WIDTH JOINER, HSP (whatever that is ???), ', ZERO WIDTH SPACE, ZERO WIDTH JOINER, s. The product of this strange combination does not honor the CSS I have set (wrong font and font size). I checked, and it does this wherever it is used. Does anyone know what is going on ? And is the template really worth the trouble? 80.132.94.160 (talk) 02:58, 11 December 2015 (UTC)Reply

Found HSP. It's "HAIR SPACE", uhm. 80.132.94.160 (talk) 03:02, 11 December 2015 (UTC)Reply
You might want to read the previous sections in this talk page. Kendall-K1 (talk) 03:07, 11 December 2015 (UTC)Reply
I did. That explains the redundant ZWJs but not the rest of the strange behavior. 80.132.94.160 (talk) 03:11, 11 December 2015 (UTC)Reply
OMFG, 5955 transclusions. I guess deletion of this template is not an option. Does anyone know a template-wizard who could fix it? 80.132.94.160 (talk) 03:18, 11 December 2015 (UTC)Reply
Taking out the ZERO WIDTH SPACE after the ' fixes the CSS problem. I have no idea where the ZWS is coming from in the first place,it is neither in this template nor in template '. 80.132.94.160 (talk) 03:31, 11 December 2015 (UTC)Reply
I suggest deprecation followed by a bot to nuke all uses. It doesn't seem to do what it claims to, and no one knows what it's good for. Kendall-K1 (talk) 04:01, 11 December 2015 (UTC)Reply
This template was created long ago to provide a simple solution for adding possessives to italicised words. Sometimes writing ''Test'''s does not play well in the wikicode. However, there is an issue with "Test" and " 's " line-wrapping separately, which is why I added the zero-width joiners. For some bizarre reason, what worked when I added them no longer does, which makes no sense, but I've removed the zero-width joiners from both this and the " ' " template. I do not know where the HSP and ZWS is coming from, but I do believe deleting these templates would not be the best option. Huntster (t @ c) 04:21, 11 December 2015 (UTC)Reply
The hair space character is the first character in the {{'}} template's transclusion and is there so that the apostrophe isn't too close to a preceding tall character, compare:
T' (''T''&#39;)
T' (''T''{{'}})
I am not sure why the zero-width space is the last character in the {{'}} transclusion, but that is what allows line-breaks. So, when this template was:
&zwj;{{'}}&zwj;s
the final transclusion was (invisible characters in parentheses):
&zwj;&zwj;(hsp)'(zws)&zwj;s
Were it up to me I would suggest this might be the correct form for {{'s}}:
&zwj;&#8202;'&zwj;s
I have a mockup of this in {{'s/sandbox}}:
T's (''T''{{'s/sandbox}}
Here is a test. All words are separated with {{'s/sandbox}} except the first which is has a space after {{'s/sandbox}}. The string should only break between the first and second words:
Lorem's Ipsum'sDolor'sSit'sAmet'sConsectetur'sAdipisicing'sElit'sSed'sDo'sEiusmod'sTempor'sIncididunt'sUt'sLabore'sEt'sDolore'sMagna'sAliqua'sUt'sEnim'sAd'sMinim'sVeniam'sQuis'sNostrud'sExercitation'sUllamco'sLaboris'sNisi'sUt'sAliquip'sEx'sEa'sCommodo'sConsequat'sDuis'sAute'sIrure'sDolor'sIn
Trappist the monk (talk) 13:29, 11 December 2015 (UTC)Reply
I've removed both instances of &zwj; from {{'s/sandbox}} so that the transclusion is just:
&#8202;'s
The above test still works
Trappist the monk (talk) 14:41, 11 December 2015 (UTC)Reply
Thank you Trappist, I learned something. But for me your test does break before the 's. I am using Firefox. 80.132.105.11 (talk) 15:20, 11 December 2015 (UTC)Reply
Though it does not trigger that CSS bug. 80.132.105.11 (talk) 15:25, 11 December 2015 (UTC)Reply
What CSS bug? This template hasn't used CSS since 2008 (removed at this edit).
I've restored the leading &zwj; to {{'s/sandbox}} so the transclusion is now:
&zwj;&#8202;'s
The Lorem'sIpsum's test above works in Google. Does it work in Firefox? Anyone using browsers where it doesn't work?
Trappist the monk (talk) 15:43, 11 December 2015 (UTC)Reply
As I described above, the 's did not honor the User-CSS I have set. The s was rendering in the wrong font, which was fixed when I removed the ZWS. This is probably very specific to my setup, and fixed anyway. But it still breaks before the 's even if I disable User-CSS. I just tested in IE11 and it also breaks. 80.132.105.11 (talk) 16:00, 11 December 2015 (UTC)Reply
@Trappist the monk:, @80.132.105.11: As discussed below, the template should be changed to &#8202;&#39;s, thus, why don't you try it on the sandbox. Lordtobi () 15:51, 11 December 2015 (UTC)Reply
Why did you modify my test?
I've changed {{'s/sandbox}} to use the suggested &#8202;&#39;s. This works for me on chrome. Other browsers? You should see:
Lorem's
Ipsum'sDolor'sSit's ... [unbroken string of text running beyond the right side of the page] ... Irure'sDolor'sIn
Trappist the monk (talk) 16:18, 11 December 2015 (UTC)Reply
I broke up the example because it went right out of the screen (Google Chrome), which Wikipedia couldn't seem to handle correctly and thus cut it, since it should also work normally. Lordtobi () 16:33, 11 December 2015 (UTC)Reply
I don't really understand what it is that you just wrote. Yes, the example does run off the right side of the screen – that was intentional. Viewing this page in chrome on both XT and Win7 machines, that is what I see. Do you have a better way of testing this template?
Trappist the monk (talk) 16:41, 11 December 2015 (UTC)Reply
I just tested it in Microsoft Edge, and the example seems to work just fine, just that it does not go out the page, which is, however, prohibited by the browser, as it adjusts all the texts, not just that one. Lordtobi () 16:37, 11 December 2015 (UTC)Reply

(undent) The whole stuff is about making it go out of the page. :) For me it still breaks the line before 's in FF42 and IE11. 80.132.105.11 (talk) 16:46, 11 December 2015 (UTC)Reply

I've change the sandbox so the transclusion is:
<span class="nowrap" style="padding-left:0.1em;">&#39;s</span>
For me, the Lorem'sIpsum's test still works and this test still works:
T' (''T''&#39;)
T‍ '​ (''T''{{'/sandbox}})
Trappist the monk (talk) 17:11, 11 December 2015 (UTC)Reply
Hey, that works in FF and IE. 80.132.105.11 (talk) 17:25, 11 December 2015 (UTC)Reply
Well, well, but it is not the point to make it run off the page, so that's nonsense. Lordtobi () 17:32, 11 December 2015 (UTC)Reply
But it is. The purpose of the test is to prove that {{'s/sandbox}}, when followed by a non-space character, does not cause inappropriate wrapping which was the complaint that caused the introduction of the &zwj;. Running the test off the edge of the screen makes it so that you and others reading this page don't have to adjust the window width to see that inappropriate line-breaks do not occur. Apparently in Firefox and IE, the test line was breaking inappropriately at the hair space character. A browser should never break the possessive form of a word at the apostrophe-s which puts those characters at the beginning of a new line. So:
This:
the line's
break
or this:
the
line's break
but not this:
the line
's break
Trappist the monk (talk) 17:59, 11 December 2015 (UTC)Reply
Trappist: Looks to me like the sandbox version is working correctly; when you feel confident in it going live, I see no reason to not proceed, and to update {{'}} and {{`}} as well. Huntster (t @ c) 21:06, 11 December 2015 (UTC)Reply
@Huntster: Since Trappist is not responding, I'd like to say that it is a great solution and should go live as soon as possible, wrapping it up:
  • Change {{'s}} to <span class="nowrap" style="padding-left:0.1em;">&#39;s</span>
  • Change {{'}} to <span class="nowrap" style="padding-left:0.1em;">&#39;</span>
  • Make {{`}} and {{}} redirect to {{'}}, as they are supposed to.
—Thanks, Lordtobi () 21:11, 21 December 2015 (UTC)Reply

Suggested change edit

Since the {{'}} template still uses zero width spaces, I'd suggest to 1) Turn the {{'}} template into &#39;, which produces the apostrophe just fine without any complications, then 2) Make the {{`}} template redirect to {{'}}, since it does the exact same thing, and 3) Make this template independent by turning it into &#39;s, which also works fine. (1 and 2 have also been stated on the {{'}} talkpage) Lordtobi () 08:09, 11 December 2015 (UTC)Reply
That sounds good. It seems to me that proper kerning is the browser's job. I understand that many browsers are incapable of doing this right, but adding our own HSP guarantees that it will be impossible for a correctly behaving browser to do the kerning itself. Making these templates simply insert their corresponding characters with no extra space or space-like characters would be fine. Kendall-K1 (talk) 12:19, 11 December 2015 (UTC)Reply
For maximum compatiblity, I'd suggest to turn {{'}} into &#8202;&#39; (&#8202; being the hair space [as Trappist mentioned above] and &#39; the apostrophe) and {{'s}} either into {{'}}s (dependent) or into &#8202;&#39;s (independent). Then, again, {{`}} should redirect to {{'}}, since it produces the same character, so that those are covered as well and that there is no need for to make a bot do it. Lordtobi () 14:14, 11 December 2015 (UTC)Reply
That would be incompatible with any browser that does kerning correctly. But I don't know if such browsers actually exist. I know mine doesn't. Kendall-K1 (talk) 16:24, 11 December 2015 (UTC)Reply
I don't know such a browser either, for anything else, the &#8202; hair space should do it, just like it did before, this time without any possible cite errors. Lordtobi () 16:29, 11 December 2015 (UTC)Reply

Does the apostrophe actually cross the T for anyone? >>> T's <<< It doesn't for me. Although it should work like Trappist describes it works in Chrome, it is probably not worth the trouble when many browsers don't support it. 80.132.105.11 (talk) 17:05, 11 December 2015 (UTC)Reply