Module:TaxonList: Difference between revisions

Content deleted Content added
updated to tested sandbox version (doesn't italicize botanical connecting forms if not linked)
remove attempt to de-italicize connecting terms in botanical names
Line 41:
 
--=========================================================================
--Utility function to italicize the taxon name. Any connecting forms used in
 
--botanical names (e.g. 'subsp.', 'f.') should not be italicized. However,
--Any connecting terms used in botanical names (e.g. 'subsp.', 'f.')
--simply de-italicizing won't work if the taxon name is also linked, since it
--should not be italicized. However, de-italicizing is a more complex issue
--will produce output of the form '<i>[[X Y</i> subsp. <i>Z]]</i>'.
--than the initial version of code commented out here, which caused problems.
--(What is needed in this case is to output
-- [[X Y subsp. Z|<i>X Y</i> subsp. <i>Z</i>]]
--but this is not currently implemented.)
--=============================================================================
function p.italicize(taxonName, linked)
-- if not linked then
-- taxonName = string.gsub(taxonName, ' %a*%. ', '</i> %0 <i>', 1)
-- end
return '<i>' .. taxonName .. '</i>'
end