Модуль:Песочница/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
     mw.title.getCurrentTitle():edit(content .. '\n<!--callCount:' .. newCount .. '-->')
     return '<!--callCount:' .. newCount .. '-->Количество вызовов: ' .. newCount
    return "Количество вызовов: " .. newCount
end
end


return p
return p