Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Sports table) (bot |
m Archiving 1 discussion(s) from Module talk:Sports table) (bot |
||
Line 598:
::::: [[User:NHammen|NHammen]], I made [//en.wikipedia.org/w/index.php?title=Module%3ASports_table&type=revision&diff=949795564&oldid=941992646 this change] which should be effectively what you had, but without the extra require. if we have a situation where there are more sports that have custom results tables, we can always refactor the code to use the equivalent of a "switch" statement there. hopefully I didn't break anything. the main reason why I stopped working on the chess submodule was lack of interest from the community. it seems like you will have more luck than I did. [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 15:45, 8 April 2020 (UTC)
:::::: [[User:Frietjes|Frietjes]], thank you. That works great! [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 17:51, 8 April 2020 (UTC)
== Possible unclosed span tag error ==
This module appears to be causing unclosed <code>span style="white-space:nowrap"</code> tags in the formatted {{para|team''n''}} table cell. You can see it if you copy the Group A table from [[2014 FIFA World Cup qualification – AFC Third Round]] into [[Special:ExpandTemplates]]. Is it possible to close these span tags? Thanks. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 15:01, 11 April 2020 (UTC)
:I see them. These tags come from the column header for the match results table. This is handled by [[Module:Sports results]], which is called from this module. This problem almost certainly arises from the get_short_name function in that module. Unfortunately, there is some rather complex gsub stuff going on there, which seems to be the source of the problem. One solution is to explicitly define {{para|short_TTT}} yourself, so that the meat of the get_short_name function is not called. But this is just hiding the fact that there is an error somewhere in this function. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 20:07, 12 April 2020 (UTC)
{{Ping|Jonesey95}}I see the problem. The command <code><nowiki>n = mw.ustring.gsub(n, '(<span class="flagicon">%s*%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*%]%][^<>]*</span>).*', '%1')</nowiki></code> removes everything after the closing span for the <code><nowiki><span class="flagicon"></nowiki></code>. But at the point it is called in this example, the only thing after that closing span is the closing span for the <code><nowiki><span style="white-space:nowrap"></nowiki></code>. I am hesitant to remove that line of code, because it must be there for a reason. Maybe it should strip everything before the <code><nowiki><span class="flagicon"></nowiki></code> as well? So that would be <code><nowiki>n = mw.ustring.gsub(n, '.*(<span class="flagicon">%s*%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*%]%][^<>]*</span>).*', '%1')</nowiki></code>. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 20:24, 12 April 2020 (UTC)
:{{Ping|Frietjes}} before I go into the sandbox to fix this issue, do you remember why the line of code in this diff (https://en.wikipedia.org/w/index.php?title=Module:Sports_results&diff=926327613&oldid=925509592) was added? I don't want to end up breaking something that you had fixed. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 20:38, 12 April 2020 (UTC)
::So, I went into the sandbox, and my addition of 2 characters does fix the issue discussed here. Still need to check if it breaks something else. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 21:21, 12 April 2020 (UTC)
:::I copied over the sandbox. I think you understand the intent of that section of code (to remove everything but the flag in the abbreviation for the team name), so removing stuff before and/or after the flag would be correct. thank you! [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 15:14, 13 April 2020 (UTC)
::::That's what I figured. Just wanted to be sure, because this could potentially have large effects. And I think I am not so good with the gsub stuff yet. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 15:56, 13 April 2020 (UTC)
:::::That looks good to me. Thanks! – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 19:38, 13 April 2020 (UTC)
|