Module:Infobox MOS: Difference between revisions

Ganaram inukshuk (talk | contribs)
m "Tamnams info" becomes "descendant info" if the mos ancestor isn't tamnams-named
Ganaram inukshuk (talk | contribs)
Fixed logic for adjacent links for multiperiod mosses
Line 88: Line 88:
}
}
-- Links that contain either "0L" or "0s" when the parent's L/s-count is 1
-- refer to degenerate mosses (null-large and null-small, or 0L/0s) and
-- links for those should be made blank instead.
for i = 1, #adjacent_links do
for i = 1, #adjacent_links do
local number_of_periods = utils._gcd(input_mos.nL, input_mos.ns)
local number_of_periods = utils._gcd(input_mos.nL, input_mos.ns)
local is_null_large = string.find(adjacent_links[i], "0L") and input_mos.nL == number_of_periods
local is_null_large = string.find(adjacent_links[i], "0L") and input_mos.nL == 1
local is_null_small = string.find(adjacent_links[i], "0s") and input_mos.ns == number_of_periods
local is_null_small = string.find(adjacent_links[i], "0s") and input_mos.ns == 1
if is_null_large or is_null_small then
if is_null_large or is_null_small then