Template talk:Ok

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Fix for when empty parameter is passed[edit]

Currently, {{OK|}} produces ✓'

Notice the dangling apostrophe: '. This is likely because when no parameter is passed in, six apostrophes are concatenated in the wikicode, which is interpreted as a single apostrophe (') followed by bold ('''), italic ('') marks. The rest of any paragraph is then bold and italic like this: this should not be bold-italic.

An easy fix would be to either :

  1. imitate {{Not done}} and surround the second langswitch with <bdi> tags (which may have an implication for RTL languages, I'm not sure);
  2. Alternatively, the bold markers could be moved inside the langswitch;
  3. Also possible would be to put a single space either after the first bold marker or before the last bold marker.

I would have just gone ahead and done #2, but this template is so extremely widely used that I would like to get a few extra pairs of eyes to make sure it won't break anything I haven't thought of. Storkk (talk) 12:18, 9 June 2016 (UTC)[reply]

After input on COM:AN, I've now carried out option 1. Storkk (talk) 08:20, 10 June 2016 (UTC)[reply]

@Storkk: After your implementation, {{OK}} produces unnecessary line breaks before and after the word "OK" when used by itself and it looks like this:

✓OK test test test

But when used in a bullet list it looks fine:

  • ✓OK test test test

--Wcam (talk) 12:41, 1 June 2018 (UTC)[reply]

@Wcam: At the end of April 2018, all these templates broke in the same fashion. Compare the behavior of this template with {{S}}, {{O}}, {{Vk}} etc. This will presumably be fixed towards the end of June with the replacement of a backend piece of software called Tidy with RemexHTML. See phabricator:T193414 and Commons:Village_pump/Archive/2018/05#.7B.7BSupport.7D.7D_.26_Co._is_broken_for_languages_other_than_English. Storkk (talk) 13:34, 1 June 2018 (UTC)[reply]