Module:head: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 34: Line 34:
for linker in mw.ustring.gmatch(head, "%*([^%*%[%]]*%[[^%*%[%]]+%][^%*]*)%*") do
for linker in mw.ustring.gmatch(head, "%*([^%*%[%]]*%[[^%*%[%]]+%][^%*]*)%*") do
local formatted = linker .. ":" .. mw.ustring.gsub(linker, "%[[^%*%[%]]+%]", "") -- turn word[s] into words:word
local formatted = linker .. ":" .. mw.ustring.gsub(linker, "%[[^%*%[%]]+%]", "") -- turn word[s] into words:word
head = mw.ustring.gsub(head, "%*" .. linker .. "%*", "*" .. formatted .. "*")
local escaped = mw.ustring.gsub(linker, "([%[%]%*])", "%$1")
head = mw.ustring.gsub(head, "%*" .. escaped .. "%*", "*" .. formatted .. "*")
end
end
end
end

Navigation menu