Template talk:Tag

Category link
editprotected
 * This protected page has been detected in [[:Category:Wikipedia formatting templates]], but that category has been redirected to [[:Category:Wikipedia formatting and function templates]]. Please update the category link. --RussBot (talk) 13:10, 27 August 2008 (UTC)
 * ✅ Done Harryboyles 17:14, 27 August 2008 (UTC)

ref group&#61;
I don't think the last example actually works. It simply throws an error:



--Subversive Sound (talk) 21:21, 27 January 2010 (UTC)

seems to be working. ---— Gadget850 (Ed)  talk 00:36, 28 January 2010 (UTC)

Re-use of same reference
Hello, how do you input the same instance of tag#ref?

I.e. so it'll look like: "The cat was in a hat.[1] Also the hat was on the cat.[1]"

As it is now it justs auto-updates numbering so it's [1] and [2] with same content.

Cheers!Sandman888 (talk) 19:28, 29 April 2010 (UTC)


 * The #tag magic word has no relationship to this tag template. #tag:ref should be used only where you need to include  tags inside a reference. The syntax is &#123;&#123;#tag:ref|content|name="name"|group="groupname"}} where the optional name and groupname must come after the content. ---— Gadget850 (Ed)  talk 23:36, 29 April 2010 (UTC)

Attributes in closing tag
Attributes used in the opening tag are placed in the closed tag. This is an error, or how should it be tagged?

foo

Douglaspaulwade (talk) 14:31, 30 June 2010 (UTC)


 * You need to use params to include text in the open tag that is not included in the close tag:


 * foo


 * foo


 * ---— Gadget850 (Ed)  talk 14:56, 30 June 2010 (UTC)use

One redundant space
Why

→  is a function of MediaWiki, not HTML or XTML. Finally got a definitive answer on this at Help talk:List-defined references. Would it be possible to remove the extra space from this template so the documentation isn't instructing editors to use an unnecessary space? It all adds up. Thanks!
 * &mdash; D'Ranged 1  VTalk  00:43, 24 February 2016 (UTC)
 * The template is not just used for demonstrating  and  (which are MediaWiki extensions, and where the space is definitely optional), but is also used for demonstrating markup in HTML, XHTML, XML, SVG and several related markup languages. In some of these the space is mandatory. -- Red rose64 (talk) 11:24, 24 February 2016 (UTC)

Is it possible that you could alter the template so that the space in question is a non-breaking space ? On mobile, where paragraphs of text are wrapped a lot more, the tags with spaces can sometimes wrap around due to the space. It's insignificant but it can be confusing when the /> is dangling on the next line. OlliverWithDoubleL (talk) 09:38, 30 July 2022 (UTC)
 * No, because the template is usually used for example code. People sometimes mark-and-copy the tag(s), and if they copied a nbsp they would then paste invalid markup. As far as HTML, XHTML and the others that I mentioned are concerned, newlines count as whitespace but nbsps do not. -- Red rose64 &#x1f339; (talk) 21:47, 30 July 2022 (UTC)

Intuitiveness problem
One of the most common styles for referring to [X]HTML mark-up is   (I'm using "..." as a literal string here). It's certainly more common than, and it should be easy to do, instead of requiring long-winded input like. By extending the, we should be able to have it default to assuming that any second parameter that does not match one of the pre-defined values is actually content, unless content is explicitly specified. After this fix,  would produce. Better yet, not only fix that (it would make it easier to do things like  to produce  ), but make the default display be the ... version, and have the odd   version be something manually obtained with a new value, empty, along with the open, closed, etc. values. — SMcCandlish  Talk⇒ ʕ(Õلō)ˀ  Contribs. 20:29, 19 June 2011 (UTC)


 * Asuming that the second parameter is content requires a lot of contitional coding, so I don't see that happening. Having said that, showing ... is easy if a pair has no content. If that is the established convention, I'll just add it.  — Edokter  ( talk ) — 22:59, 19 June 2011 (UTC)
 * That would be very helpful.  — SMcCandlish ☺ ☏ ¢ ≽ʌⱷ҅ᴥⱷʌ≼  11:49, 13 August 2014 (UTC)

Style
With the style change to, I propose to with to switch to. The box is just too much. --  Gadget850talk 15:34, 10 August 2014 (UTC)
 * But semantically, its output is code.  18:56, 10 August 2014 (UTC)
 * But it is keyboard code, not output. --  Gadget850talk 19:55, 10 August 2014 (UTC)
 * I ment the template's output; the HTML is code.  20:32, 10 August 2014 (UTC)
 * I give up. I overrode the style in my CSS. Help:HTML in wikitext will just have to look horrible to everyone else. --  Gadget850talk 01:04, 11 August 2014 (UTC)
 * It's not that bad, and we didn't have a mass-complaint campaign.  08:52, 11 August 2014 (UTC)
 * This is wrong; we don't abandon use of the correct markup () to get around a style issue; just fix it with CSS. The  element is for examples of user input (i.e. the  of parameters, and only when we're giving literal examples, not variables, for which use </var>), not the   code!  It's semantically incorrect to use kbd this way.  See Jonesey95's CSS fixes at the essentially duplicate discussions at Help talk:Citation style 1 and Template talk:Para.  — SMcCandlish ☺ ☏ ¢ ≽ʌⱷ҅ᴥⱷʌ≼  11:52, 13 August 2014 (UTC)

Fixed for me in personal CSS. --  Gadget850talk 12:58, 13 August 2014 (UTC)
 * Not Jonesey95's CSS fix - mine. See Village pump (technical)/Archive 129 and search for "inherit". -- Red rose64 (talk) 15:20, 13 August 2014 (UTC)
 * Answered at Help talk:Citation Style 1/Archive 5.
 * Re: "Resolved" – Fair enough for your part, but proposals to make semantic-HTML-breaking changes have continued at Template talk:Para. &lt;sigh>  — SMcCandlish ☺ ☏ ¢ ≽ʌⱷ҅ᴥⱷʌ≼  19:21, 13 August 2014 (UTC)

Let's consolidate this discussion at Template talk:Para. Having it forked like this is pointless and already leading to conflicting proposals. — SMcCandlish ☺ ☏ ¢ ≽ʌⱷ҅ᴥⱷʌ≼  19:21, 13 August 2014 (UTC)

Changes
Would y'all please work this out in the sandbox and talk page. I can't follow the issues from edit summaries. --  Gadget850talk 21:32, 14 December 2014 (UTC)
 * I try to, but if others don't, I can't either.  22:38, 14 December 2014 (UTC)
 * How about we revert back to, give it a full-prot and discuss? I see nothing above that proposes, let alone supports, any of the recent changes. -- Red rose64 (talk) 10:48, 15 December 2014 (UTC)
 * I agree, this should have been discussed first.  12:16, 15 December 2014 (UTC)

Name tag
Is it possible to add a name parameter (like with .... ) if multiple targets on a page needs the same tag. Thanks, Sander.v.Ginkel (Je suis Charlie) 12:12, 5 March 2015 (UTC)
 * You can use params for that. See the documentation.  12:23, 5 March 2015 (UTC)

Template edit request
Could somebody add another parameter which is similar to single / s but does not include a space before the slash?

→  ―  PapíDimmi  (  talk  |  contribs  ) 17:21, 17 May 2017 (UTC)
 * Example
 * Red information icon with gradient background.svg Not done: please establish a consensus for this alteration before using the template. This doesn't seem to add any value to the template, TBH. This template is for demonstration of a tag, not to provide a user any which way to display trivial whitespace. Izno (talk) 21:01, 17 May 2017 (UTC)

Closing tag broken
Closing tags aren't displayed. For example results in:. This is also evidenced in the the documentation. Anon 126  (notify me of responses! / talk / contribs) 00:41, 6 August 2017 (UTC)
 * Yes check.svg Done – Train2104 (t • c) 01:04, 6 August 2017 (UTC)

Template-protected edit request on 29 June 2018
I have worked on the coding for this template to modify the rendering for the HTML hidden comment which currently renders as seeming odd without white space on each side of the comment; the normal appearance when that markup is in use. The hidden comments above and below this request (as seen when editing the page) demonstrates hiding text with HTML comment tags and the white space mentioned here is easily observable from the markup in use. The modified coding causes the hidden comment example to render instead as ; consistent with the markup's standard appearance normal to its use. All of the other tag examples are unaffected by the code modifications associated with this edit request, and they remain unchanged under the modified coding. The template's documentation uses 14 examples to encompass its functionality. All 14 are listed on Template:Tag/testcases along with the same examples rendering from the modified coding, as drawn from Template:Tag/sandbox. The comparisons demonstrate the new code's fitness for its requested use herein. To effect this edit request, I am asking for Template:Tag to be completely blanked, and for its content to be replaced by ''' the complete coding that is in the sandbox by this edit. ''' Thank you. --John Cline (talk) 01:30, 30 June 2018 (UTC)
 * I have set answered to yes; placing this request on hold. There are other aspects of this change that require testing I have yet to do. I will request this edit anew if and when these additional tests are successfully logged. Thank you.--John Cline (talk) 03:18, 2 July 2018 (UTC)

Redundant space (again)
Though the space often used in void element tags (i.e., ) may have been the proper usage in the past, MediaWiki now seems to convert said usage to. (You can see this by opening the page source of any Wikipedia article containing a .) So, now that the space is actually redundant (unlike the last time this was brought up), can we get rid of it? Mr. Starfleet Command (talk &bull; contributions) 13:14, 23 March 2024 (UTC) B
 * I refer you to my post of 11:24, 24 February 2016 (UTC): The template is ... also used for demonstrating markup in HTML, XHTML, XML, SVG and several related markup languages. In some of these the space is mandatory. -- Red rose64 &#x1f339; (talk) 14:24, 23 March 2024 (UTC)
 * Fair enough. However, there are some instances where this template needs to give a result without the space, such as at H:BR, which currently tells us that "All of them [ ] are converted to  in the HTML that browsers read." This is incorrect, as they are actually converted into  . Do you recommend editing that page to manually declare , or should an option be added to this template allowing for the removal of the space? Mr. Starfleet Command (talk &bull; contributions) 14:44, 23 March 2024 (UTC)
 * Always give examples when you state that such-and-such happens. I've tried viewing the source for Iffley Halt railway station, using the feature of Firefox. In that, I see three br tags with a space, and none without. So I don't see a need for any change to this template. I would also refer you to the post of 21:01, 17 May 2017 (UTC) by . -- Red rose64 &#x1f339; (talk) 17:52, 23 March 2024 (UTC)
 * Here is some brs of each form:
 * : A B
 * : A B
 * : A B
 * : A
 * Interestingly, in Firefox source view (Ctrl + U), these all get normalized to ; when viewing in Firefox console (F12) they all get normalized as  . I think the source view is what MediaWiki is generating and the console is just the 'prettified' version because developers prefer to think in HTML 5 and not in XHTML.
 * That would seem to suggest that some browsers are doing different things with their display, possibly. One would need to investigate the code path in MediaWiki directly or pull out the good old Wireshark. Izno (talk) 18:09, 23 March 2024 (UTC)
 * On Chrome, the tags are normalized to  in the page source, while they become  in the console. Given the info you have both provided, it seems that MediaWiki converts the tags slightly differently on different browsers (with the space on Firefox, without it on Chrome). In the end, the browsers both seem to convert it to, which is why that displays in the console.
 * So the accurate statement for H:BR would be, "The MediaWiki software uses any of them for a single forced line break, converting them to  or, depending on which browser is being used." The question at hand is how to achieve this. Should we simply use  , or should we add that functionality to this template? I support the latter, as it simplifies the process and would make it easier to illustrate these differences on other pages.
 * Do you have an opinion on the matter, Izno? Mr. Starfleet Command (talk &bull; contributions) 18:37, 23 March 2024 (UTC)
 * No, we can say pretty certainly say that MediaWiki is not varying the output HTML based on browser just for the br tag (otherwise the caches would double). Something in the browsers is being funky, so someone should consult the MediaWiki source to verify what it's actually being output as.
 * Either way, you do not to use this template for arbitrary tags. I have demonstrated two ways in the response above (nowiki, as well as character escape) that suffice for a particular page if this template does not provide the precision necessary. Izno (talk) 19:01, 23 March 2024 (UTC)
 * OK, my mistake on the first point. (Incidentally, how would one "consult the MediaWiki source"?)
 * And yes, I know we don't need to use this template. That's why I gave two options: update the template, or do it manually, i.e. use . I didn't say the former was the only way, just more clean-looking on pages where the   version is needed. But I'm happy to go along with whatever you think would be the better option. Mr. Starfleet Command (talk &bull; contributions) 19:12, 23 March 2024 (UTC)
 * You would use a command-line utility such as wget to retrieve the page to your device, this performs no client-side processing so what you get back is the HTML source exactly as it is served. Then you would use a plain text editor like vi or WordPad to examine its contents, search for  and look at the next few characters. Unfortunately I can't do this myself: my copy of wget is from about 2009 and won't retrieve pages from servers that require https: - it's not worked for WMF-hosted sites for four or five years now. -- Red rose64 &#x1f339; (talk) 21:00, 23 March 2024 (UTC)
 * The source for MediaWiki can be found at Wikimedia Gerrit. I'd personally start from Parser.php. Izno (talk) 21:56, 23 March 2024 (UTC)
 * Forgive my ignorance, but how do I get to Parser.php from the link you provided? :( Mr. Starfleet Command (talk &bull; contributions) 22:25, 23 March 2024 (UTC)