Module:grc-correlatives

local ugsub = mw.ustring.gsub local decompose = mw.ustring.toNFD local U = require("Module:string/char") local macron = U(0x304) local breve = U(0x306)

local export = {}

local function make_edit_link(title) local URL = tostring(mw.uri.fullUrl(title, "action=edit")) return ' [' .. URL .. ' edit] ' end

-- Here, anything in template parameter notation,, will be linked -- with no transliteration, like. local template = [=[ Ancient Greek correlatives (]=] .. make_edit_link("Module:grc-correlatives") .. [=[)

function export.show(frame) if next(frame.args) then error("This module function does not require any parameters.") end local function make_entry_name(text) text = ugsub(decompose(text), "[" .. macron .. breve .. "]", "") return text end local title = decompose(mw.title.getCurrentTitle.text) local function link_or_not(text) if text:find("", 1, true) then			return text:gsub("%[%[([^%+)%]%]", link_or_not) else local entry_name = make_entry_name(text) if entry_name ~= title then return  .. text ..  else return ' ' .. text .. ' '			end end end local function tag(text) return ' ' .. link_or_not(text) .. ' '	end return (template:gsub('}', tag)) end

return export