------ ! This module is currently Pre-Alpha and not ready for testing.----
-- This module provides consistent formatting for common information included in-- the spouse parameter of an Infobox_person.-- It is intended to be used by Template:Marriage and not invoked directly within pages.
local getArgs = require('Module:Arguments').getArgs
function makeSet(items) local set = for _, i in ipairs(items) do set[i] = true end return setend
values_died = makeSetvalues_divorced = makeSetvalues_separated = makeSetvalues_annulled = makeSet
abbr_married = ""abbr_divorced = ""abbr_separated = ""abbr_annulled = ""
local p =
function p.main(frame) local args = getArgs(frame,) return mw.html.create:wikitext(p._main(args))end
function p._main(args) local reason_abbr = "" local marriage_info = "" local return_value = ""
local spouse_name = args[1] or "" local date_start = args[2] or "" local date_end = args[3] or "" local end_reason_raw = args["end"] or args["reason"] or "" if end_reason_raw
"" and date_end
"" then -- If no dates or reason provided, the template is not useful, return nothing. -- (nothing for now, but we'll add a warning message later on to be shown in preview) return ""
elseif date_start
"" then marriage_info = "(" .. end_reason .. ")" elseif date_start
"" and end_reason
"" then marriage_info = "(" .. abbr_married .. " " .. date_start .. "; " .. end_reason .. ")" elseif end_reason
if spouse_name
return p