Module:Navbox: Difference between revisions

From Test Wiki
6 bytes added ,  17 April 2023
Fixing ternary expression short-circuit ("foo and nil or bar" is always equal to "bar", but "not foo and bar or nil" produces the intended effect)
(add hlist support, move related strings to cfg, add support for finding classes in any class parameter)
(Fixing ternary expression short-circuit ("foo and nil or bar" is always equal to "bar", but "not foo and bar or nil" produces the intended effect))
Line 141: Line 141:
:tag('div')
:tag('div')
-- id for aria-labelledby attribute, if no title
-- id for aria-labelledby attribute, if no title
:attr('id', args[cfg.arg.title] and nil or mw.uri.anchorEncode(args[cfg.arg.above]))
:attr('id', (not args[cfg.arg.title]) and mw.uri.anchorEncode(args[cfg.arg.above]) or nil)
:wikitext(processItem(args[cfg.arg.above], args[cfg.arg.nowrapitems]))
:wikitext(processItem(args[cfg.arg.above], args[cfg.arg.nowrapitems]))
end
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.