Модуль:Поиск шаблона страницы: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 4: | Строка 4: | ||
local args = frame.args | local args = frame.args | ||
local searchText = args[1] or "" | local searchText = args[1] or "" | ||
searchText = searchText:gsub("<nowiki>", ""):gsub("</nowiki>", "") | |||
local title = mw.title.getCurrentTitle() | local title = mw.title.getCurrentTitle() | ||
local content = title:getContent() | local content = title:getContent() | ||
| Строка 14: | Строка 16: | ||
local cleanedContent = content:gsub("{{#invoke:Поиск строк страницы|main|[^}]+}}", "") | local cleanedContent = content:gsub("{{#invoke:Поиск строк страницы|main|[^}]+}}", "") | ||
cleanedContent = cleanedContent:gsub("<code>[^<]+</code>", "") | cleanedContent = cleanedContent:gsub("<code>[^<]+</code>", "") | ||
cleanedContent = cleanedContent:gsub("<nowiki>[^<]+</nowiki>", "") | |||
if not cleanedContent:match(searchText) then | if not cleanedContent:match(searchText) then | ||