Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 2: | Строка 2: | ||
function p.increment(frame) | function p.increment(frame) | ||
local content = mw.title.getCurrentTitle():getContent() | local content = mw.title.getCurrentTitle():getContent() or "" | ||
local currentCount = tonumber(content:match('<!--callCount:(%d+)-->')) or 0 | local currentCount = tonumber(content:match('<!--callCount:(%d+)-->')) or 0 | ||
local newCount = currentCount + 1 | local newCount = currentCount + 1 | ||
return '<!--callCount:' .. newCount .. '-->Количество вызовов: ' .. newCount | |||
end | end | ||
return p | return p | ||