Module:head: Difference between revisions

m
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
mNo edit summary
Line 65: Line 65:
if mw.ustring.find(inflection[i], "%*") then
if mw.ustring.find(inflection[i], "%*") then
local before = mw.ustring.match(inflection[i], "^([^%*]+)%s*%*") or ""
local before = mw.ustring.match(inflection[i], "^([^%*]+)%s*%*") or ""
local before_space = mw.ustring.match(inflection[i], "^[^%*]+(%s*)%*") or ""
local after = mw.ustring.match(inflection[i], "%*%s*([^%*]+)$") or ""
local after = mw.ustring.match(inflection[i], "%*%s*([^%*]+)$") or ""
local after_space = mw.ustring.match(inflection[i], "%*(%s*)[^%*]+$") or ""
if before ~= "" then before = m_links.full_link({term = before, language = data.language}, "bold") end
if before ~= "" then before = m_links.full_link({term = before, language = data.language}, "bold") end
if after ~= "" then after = m_links.full_link({term = after, language = data.language}, "bold") end
if after ~= "" then after = m_links.full_link({term = after, language = data.language}, "bold") end
local head_temp = mw.ustring.match(inflection[i], "(%s*%*%s*)")
head_temp = mw.ustring.gsub(head_temp, "%*", "<b>" .. data.term .. "</b>")
table.insert(i_forms, before .. head_temp .. after)
table.insert(i_forms, before .. before_space .. "<b>" ..data.term .. "</b>" .. after_space .. after)
end
end
else
else