Your website is probably italicizing plant names wrong – DEV Community

Correcting the Typography of Botanical Names on Websites

Correcting the Typography of Botanical Names on Websites

The article discusses a common mistake in how websites format botanical names, specifically the incorrect use of italics. Most websites wrap entire plant names in italics, but according to botanical naming conventions (ICN for wild plants and ICNCP for cultivated ones), only certain parts should be italicized. The genus, species epithet, and infraspecific epithets should be italicized, while rank markers (such as subsp., var., f.), author citations, hybrid signs (×), cultivar groups, and cultivar names (which go in single quotes) should not be italicized. For example, ‘Hosta ‘Blue Angel” should be formatted as Hosta ‘Blue Angel’ with only ‘Hosta’ italicized. The author noticed this error on their plant app, PlantGeekz, while building a library for botanical names. The article explains that plant names often arrive in inconsistent formats from various sources, such as spreadsheets, nursery catalogs, and user input, with issues like incorrect symbols (x instead of ×), misspelled abbreviations (ssp. instead of subsp.), and improper use of quotes. To address this, the author developed a zero-dependency library called botanical-name for PHP and JavaScript/TypeScript that correctly parses and formats botanical names according to the established rules. The library handles various edge cases, such as apostrophes within cultivar names, capital X inside names, and names in brackets. The author tested the library on 30,569 real plant names from their taxonomy database, identifying three unexpected issues that their initial test cases had not covered. The library is MIT-licensed and available on GitHub, with the goal of helping websites correctly format botanical names to adhere to scientific standards. The article concludes by inviting readers to try the library and contribute to its improvement by reporting any names it gets wrong.

Leave a Reply

Your email address will not be published. Required fields are marked *