Module talk:WikiProject banner/Archive 14: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Template talk:WPBannerMeta) (bot
m Archiving 1 discussion(s) from Template talk:WPBannerMeta) (bot
Line 21:
::::Thanks WOS! &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 13:34, 3 July 2023 (UTC)
:::@[[User:MSGJ|MSGJ]]: <small>[Thank you for the [[Help:Notifications|ping]]]</small><!--User:MJL/ty4p--> <small>For the record, I use they/them pronouns rather than he/she.</small><br />Glad this got solved. While I did attempt to work on that template in the past, I [[Special:Diff/895554174|self-reverted]] all my changes when I broke something. I probably wasn't going to be much of a help here. &#8211;<span style="font-family:CG Times, times">[[User:MJL|<span style="color:black">MJL</span>]]&thinsp;[[User talk:MJL|‐'''Talk'''‐]]<sup>[[User:MJL/P|☖]]</sup></span> 17:12, 3 July 2023 (UTC)
 
== minor comment on Module:WikiProject banner ==
 
Just a minor comment: the invocation of <syntaxhighlight lang="Lua" inline>banner_rows:allDone()</syntaxhighlight> on [//en.wikipedia.org/w/index.php?title=Module:WikiProject_banner&oldid=1163075014#L-614 line 614] is essentially a no-op, as the return value isn't being stored. [[User:Isaacl|isaacl]] ([[User talk:Isaacl|talk]]) 21:22, 4 July 2023 (UTC)
 
:Understood. When I first coded this I assumed the done() were required in order to close the tags. Then I noticed that none of your examples on WT:LUA had them so guessed that tags were closed automagically. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 21:26, 4 July 2023 (UTC)
::Sure, if you had a mental model of an ongoing string of text being built up, I understand how you might think this. What happens though is that the function calls build a tree of objects representing the HTML. When <syntaxhighlight lang="Lua" inline>tostring()</syntaxhighlight> is invoked on the banner variable, the tree is rendered into HTML, and thus as the tree is traversed, the corresponding start and end tags will be generated. [[User:Isaacl|isaacl]] ([[User talk:Isaacl|talk]]) 22:00, 4 July 2023 (UTC)