local p =
p.reign = function(frame) local start = frame.args.start or "?" local ending = frame.args.ending or "" local sec_start = frame.args.sec_start local sec_ending = frame.args.sec_ending local label = frame.args.label local single = frame.args.single local show = frame.args.show local cap = frame.args.cap local pre_date = frame.args.pre_date local post_date = frame.args.post_date local mid_date = frame.args.mid_date local era = frame.args.era local abbr = "r." local ndash = " - " local nbsp = " " if start
"none" then abbr = "r." end if show
"word" then abbr = "reigned" end if show
"lword" then abbr = "reigned" end if show
"blank" then abbr = "" end if cap ~= null then if show
"link" then abbr = "R." end if show
"colon" then abbr = "Reign:" end if show
"lcolon" then abbr = "Reign:" end end if single then msg = single end if not single and not pre_date then msg = start.. ndash ..ending end if string.match(start, ' ') ~= nil or string.match(ending, ' ') ~= nil then msg = start.. nbsp.. ndash.. nbsp.. ending end if mid_date and sec_start and sec_ending and start and ending and string.match(sec_start, ' ') ~= nil and string.match(sec_ending, ' ') ~= nil then msg = msg.. ", " ..mid_date.. ", " ..sec_start.. ndash ..sec_ending end if sec_start and sec_ending and not mid_date and string.match(sec_start, ' ')
nil then msg = msg.. " and " ..sec_start.. ndash ..sec_ending end if sec_start and sec_ending and not mid_date and (string.match(sec_start, ' ') ~= nil or string.match(sec_ending, ' ') ~= nil) then msg = msg.. " and " ..sec_start.. nbsp.. ndash.. nbsp.. sec_ending end if sec_start and sec_ending and mid_date and (string.match(sec_start, ' ') ~= nil or string.match(sec_ending, ' ') ~= nil) then msg = msg.. ", " ..mid_date.. ", " ..sec_start.. nbsp.. ndash.. nbsp.. sec_ending end if pre_date and not post_date then msg = pre_date.. ", " ..msg end if post_dat and not pre_date then msg = msg.. ", " ..post_date end if post_date and pre_date and (start
"") and ending
return p