Jump to content

Wikipedia talk:Shortdesc helper

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Shortdesc helper JS)
Latest comment: 5 days ago by Novem Linguae in topic Bug with short descriptions containing "$1"

Short descriptions should be the first thing in the wikitext.

[edit]

As per MOS:ORDER, the short description template should be the very first thing in the article's wikitext. Could somebody modify this gadget so that edits using it enforce this? It would also be good to have the gadget ensure that the wikitext uses the template only once.

On a similar note, it may be good to have it check for violations of the more basic rules at WP:SDFORMAT and WP:SDAVOID, such as "a short description should not start with an article", "a short description should start with a capital letter", and "a short description should not end with a period". However, there are cases where those rules should be broken, so rather than refusing to save the short description, the gadget should merely display a warning that the proposed short description might break the rules. — LucasBrown 01:29, 21 February 2026 (UTC)Reply

AWB should take care of any MOS:ORDER issues. As for the rest, have you looked at Wikipedia:WikiProject Short descriptions#Maintenance categories and the following "Database reports" section? The features you request may be possible, but there are edge cases, as you note, and building complexity into a simple tool can sometimes lead to more problems instead of fewer. – Jonesey95 (talk) 18:17, 21 February 2026 (UTC)Reply

Interface-protected edit request on 21 February 2026

[edit]

Add link descriptions because "this page" is not descriptive:

<a href = "/wiki/Wikipedia:Short_description#SDNONE">this page</a>
+
<a href = "/wiki/Wikipedia:Short_description#SDNONE">WP:SDNONE</a>
<a href = "/wiki/Wikipedia:WikiProject_Short_descriptions#Auto-generated_and_bot-generated_descriptions"> this page</a>
+
<a href = "/wiki/Wikipedia:WikiProject_Short_descriptions#Auto-generated_and_bot-generated_descriptions">Auto-generated and bot-generated descriptions</a>

This is recommended by Web Content Accessibility Guideline (WCAG) 2.4.4 Link Purpose (In Context): "The purpose of each link can be determined from the link text ...

W.andrea (talk) 23:31, 21 February 2026 (UTC)Reply

 Done Sohom (talk) 23:40, 21 February 2026 (UTC)Reply

Short description bug

[edit]
How it looks on my screen, despite there being one.

I just removed two short descriptions on the 2026 Afghanistan–Pakistan war article and I see that GuesanLoyalist previously removed 6 short descriptions on the same article. Right now I see "Missing article description (Add)" where the short description should be, despite the code {{Short description|Armed conflict in Western Asia}} being on the article. I see that lots of the edits adding short descriptions has a tag linking to Wikipedia:Shortdesc helper, so I am guessing there's a bug with the shortdesc helper. The "Missing article description (Add)" is from the shortdesc helper, as I also have it enabled. I think whatever is causing this bug should be fixed, so that editors don't add a bunch of short descriptions to articles that already have them. - Sebbog13 (talk) 01:47, 28 February 2026 (UTC)Reply

Fixed with this edit to a navbox. Not a bug in the SD helper. The SD for that article was set to "none" by a template at the bottom of the article. The root problem is that the MediaWiki software looks for the last SD template in the article, and we chose to put SD templates at the top of the page. It has been ever thus. – Jonesey95 (talk) 02:57, 28 February 2026 (UTC)Reply
Thanks for fixing it. I got a bit confused. Maybe a short description that isn't empty should be prioritized over an empty one. - Sebbog13 (talk) 03:11, 28 February 2026 (UTC)Reply
The problem here is that a navigation template included a short description template. Also that it set it to "none". Also that it did not set the "noreplace" parameter. Infobox templates often set a default short description. They must (should!) always set "noreplace", so that a short description template at the top of the article, in front of the infobox, is the value that is used. Not a value in any following template — GhostInTheMachine talk to me 18:08, 28 February 2026 (UTC)Reply
I'm pretty sure that if we put our SD templates at the bottom of each article, below the stub templates (see Wikipedia:Manual of Style/Layout), we would not have to use noreplace at all. I think this horse is well out of the barn, however. – Jonesey95 (talk) 21:55, 28 February 2026 (UTC)Reply
Maybe, but that ship has definitely sailed — GhostInTheMachine talk to me 20:37, 2 March 2026 (UTC)Reply

Color in dark mode

[edit]

Hi. The DarkRed color associated with the sdh-missing-description class (from MediaWiki:Gadget-Shortdesc-helper.css) is not very readable in dark mode. Could you please replace it with a Codex color, for instance var(--color-destructive--hover, #9f3526) or var(--color-destructive, #bf3c2c)? Thanks, — Antimuonium talk 09:46, 21 March 2026 (UTC)Reply

Bug with short descriptions containing "$1"

[edit]

I just attempted to change the short description of Gold dollar from "U.S. one-dollar coin (1849–1889)" to "Gold $1 coin of the United States" using SDH, but the result was "Gold U.S. one-dollar coin (1849–1889) coin of the United States". I tried it again, but the result was "Gold Gold U.S. one-dollar coin (1849–1889) coin of the United States coin of the United States". I fixed the issue using the source editor. A similar situation also occurred when I tried to do "Gold $10 coin of the United States" at Eagle (United States coin). I believe this has something to do with SDH interpreting "$1" as some sort of scripting parameter, but I could be wrong. - ZLEA TǀC 02:11, 9 August 2026 (UTC)Reply

Not to avoid the issue, but what was wrong with "U.S. one-dollar coin (1849–1889)"? – Jonesey95 (talk) 02:31, 9 August 2026 (UTC)Reply
The dates without context implied that it was the primary iteration of the US dollar coin minted from 1849 to 1889, whereas it was actually minted alongside the definitive silver dollar due to the influx of gold from the California gold rush. If course, any further discussion on this should probably be brought to the article's talk page. - ZLEA TǀC 03:10, 9 August 2026 (UTC)Reply
$1 is used in JavaScript RegEx replace. There could be some unescaped RegEx going on. –Novem Linguae (talk) 03:40, 9 August 2026 (UTC)Reply
If you really need to display the dollar sign, you could try using its numeric character reference, specifically, &#x24; or the decimal equivalent &#36; or even the character entity reference &dollar;. These display as $, $ and $ respectively. --Redrose64 🌹 (talk) 07:31, 9 August 2026 (UTC)Reply
Problem is that we can't expect editors to even think to use those when the primary version of the character appears on many English-language keyboards. If the problem can't be fixed directly, then there should at least be a warning when trying to save a short description containing "$". - ZLEA TǀC 05:23, 10 August 2026 (UTC)Reply
I'm sure with engineering time it could be fixed directly. Redrose64 is just suggesting workarounds in the meantime. –Novem Linguae (talk) 20:02, 10 August 2026 (UTC)Reply