Module:head: Difference between revisions

Jump to navigation Jump to search
m
Added * → headword functionality
mNo edit summary
m (Added * → headword functionality)
Line 59: Line 59:
table.insert(i_forms, "<b>" .. inflection[i] .. "</b>")
table.insert(i_forms, "<b>" .. inflection[i] .. "</b>")
else
else
table.insert(i_forms, m_links.full_link({term = inflection[i], language = data.language}, "bold"))
if mw.ustring.find(inflection[i], "%*") then
local temp_links = {}
if mw.ustring.find(inflection[i], "%*") then
local before = mw.ustring.match(inflection[i], "^([^%*]+)%S?%*") or ""
local after = mw.ustring.match(inflection[i], "%*%S?([^%*]+)$") or ""
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
local head_temp = mw.ustring.match(inflection[i], "(%S?%*%S?)")
head_temp.mw.ustring.gsub("%*", "<b>" .. data.term .. "</b>")
table.insert(i_forms, before .. head_temp .. after)
end
else
table.insert(i_forms, m_links.full_link({term = inflection[i], language = data.language}, "bold"))
end
end
end
i = i + 1
i = i + 1

Navigation menu