Модуль:Карточка: различия между версиями
CatBG (обсуждение | вклад) мНет описания правки |
CatBG (обсуждение | вклад) Нет описания правки |
||
| (не показаны 3 промежуточные версии этого же участника) | |||
| Строка 194: | Строка 194: | ||
if args.title then | if args.title then | ||
local node = h.printTitleWrapper(out) | local node = h.printTitleWrapper(out) | ||
node:wikitext( | if args.title_color then | ||
node:css('color', args.title_color) | |||
end | |||
node:wikitext(h.capitalizeTitle(args.title, args)) | |||
end | end | ||
end | end | ||
| Строка 707: | Строка 710: | ||
-- try not to totally fail here | -- try not to totally fail here | ||
return h.htmlEntities[h.entityType or 'div'][key] | return h.htmlEntities[h.entityType or 'div'][key] | ||
end | |||
function h.capitalizeTitle(text, args) | |||
if h.castBool(args.capitalize_title or 'yes') then | |||
return "{{ucfirst:" .. text .. "}}" | |||
end | |||
return text | |||
end | end | ||
return p | return p | ||