Jump to content

Template talk:Asbox

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

i18n unfriendly normalization

[edit]

This line,

		local tsort, cat = args['tempsort' .. v], mw.ustring.gsub(args['category' .. v], '[^%w%p%s]', '')--remove all hidden unicode chars

is making this module not useful for other wikis where ZWNJ (and maybe ZWJ) is used in category titles which they aren't a part of %w, %p and %s so I had to add ZWNJ to them on fawiki, can you avoid the replace or allow the characters that actually have semantic use at least in other languages? Thanks! −ebrahimtalk 19:03, 22 March 2021 (UTC)[reply]

This can be applied to fix this. −ebrahimtalk 19:18, 22 March 2021 (UTC)[reply]
The code is there for a very good reason: see Template talk:Asbox/Archive 4#Obscure errors. Any changes must not cause those problems to recur. --Redrose64 🌹 (talk) 21:53, 22 March 2021 (UTC)[reply]
Interesting issue. LRM, RLM shouldn't be used at titles of course but ZWNJ is different, running
sql fawiki` with `SELECT COUNT(*) FROM page WHERE page_title LIKE '%‌%' AND page_is_redirect = 0 AND page_namespace = 14;
(ZWNJ is in between of %%) gives 287200 so there is 287200 categories with ZWNJ on fawiki, there can be a balance here I believe, one can go for eliminating all the non-Latin characters on English Wikipedia and one can allow all the things, I'm not suggesting either at the moment but just to add ZWJ and ZWNJ. −ebrahimtalk 18:31, 23 March 2021 (UTC)[reply]
 Done @Ebrahim: I've made a similar change to the last-requested one. Izno (talk) 01:43, 5 June 2021 (UTC)[reply]
Izno: Would you please add ZWJ and ZWNJ also as the original request? Just allowing that two unicode points wouldn't be hurtful so in future English Wikipedia applies the same logic on other places based on the same reasoning updating Lua module wouldn't have silently failures for us. Thanks −ebrahimtalk 09:25, 5 June 2021 (UTC)[reply]
@Ebrahim: Please make it obvious in our sandbox what it is you want to add. I look at the presented diff from fa.wp and even the en.wp version of the same and do not see a meaningful difference, which is bad. If you're going to use hidden characters in a pattern, use their Unicode references as in Module:Citation/CS1/Configuration (see invisible_chars) so that other users do not a) possibly remove them in the future unintentionally and b) so that the exact characters are trivially inspected for reasonability. Izno (talk) 16:15, 5 June 2021 (UTC)[reply]
Izno: My bad, sure, I didn't know about how to encode them like that in Lua, thanks for the pointer, https://en.wikipedia.org/?diff=1027068468ebrahimtalk 22:39, 5 June 2021 (UTC)[reply]
As the above discussion please consider applying this change as the same change in Persian Wikipedia resolves our issue and I think it makes sense to keep such code changes upstream so no silent failures happens on module updates. Thanks! −ebrahimtalk 10:00, 11 June 2021 (UTC)[reply]
 Done — Martin (MSGJ · talk) 11:07, 21 June 2021 (UTC)[reply]

Sandboxes in main module

[edit]

MSGJ Your recent edit started using sandboxes in the live module. This is of course not good. Could you take care of it? --Trialpears (talk) 11:32, 21 June 2021 (UTC)[reply]

Thanks for letting me know, fixed — Martin (MSGJ · talk) 11:37, 21 June 2021 (UTC)[reply]

Is there a particular reason use of the |imagealt= parameter is tracked in Category:Stub message templates needing attention? I am not really understanding what needs to be "fixed", unless the fix is removing the parameter. Best, HouseBlaster (talk • he/they) 01:31, 23 September 2024 (UTC)[reply]

CSS edit request

[edit]

Per consensus here, the following should be added to Template:Asbox/styles.css:

:not(p):not(.asbox) + style + .asbox {
	margin-top: 3em;
}

Once this is added, we can remove (or revise) the line about leaving two blank lines before stub templates from WP:STUBSPACING.

Apologies if I'm doing this wrong, this is the first time I've made an edit request.

Mr. Starfleet Command (talk) 23:00, 13 December 2024 (UTC)[reply]

@Mr. Starfleet Command: happy to implement the consensus. Do you have any testcases to show it works as intended in all situations? — Martin (MSGJ · talk) 18:40, 16 December 2024 (UTC)[reply]
@MSGJ I have tested it out in my personal CSS, and it seems to work good there. How would I go about creating a testcase? Or is testing it in my personal CSS good enough? Mr. Starfleet Command (talk) 19:46, 16 December 2024 (UTC)[reply]
I've added it to the sandbox, so it can be tested with Template:Asbox/sandbox. The usual place for test cases would be Template:Asbox/testcases if that works? — Martin (MSGJ · talk) 20:41, 16 December 2024 (UTC)[reply]
@MSGJ OK, I've added test cases at Template:Asbox/testcases#Top-margin testing. I also made a slight tweak to the CSS.
The only issue I see is if a stub template directly follows a paragraph, without a navbox, list, or anything else between, in which case no extra margin is applied. The only way I can think of to fix this would be to replace :not(p) with :not(p:has(> br)), but TemplateStyles doesn't support :has(), so this CSS would then have to be added to MediaWiki:Common.css or somewhere similar, which is not ideal to say the least.
Come to think of it, I don't think I've ever seen a stub template directly preceded by a paragraph; does that happen much? Mr. Starfleet Command (talk) 23:30, 16 December 2024 (UTC)[reply]
(Not to mention, :has() has only been fully supported by all major browsers since 2023, so probably shouldn't be used just yet.) Mr. Starfleet Command (talk) 23:39, 16 December 2024 (UTC)[reply]
I will deploy this later today unless someone gets there before me — Martin (MSGJ · talk) 08:48, 17 December 2024 (UTC)[reply]