Module talk:TaxonItalics/moretestcases: Difference between revisions

Content deleted Content added
No edit summary
Fix Linter errors. Let's not demonstrate invalid syntax if we don't have to.
 
(4 intermediate revisions by one other user not shown)
Line 2:
 
;Issues
* ABy default, a parenthesized part of a taxon name is assumed to be a subgenus, and so is italicized. This is correct for {{#invoke:TaxonItalics|main|Mus (Mus)|linked=yes}}, but not for {{#invoke:TaxonItalics|main|CaiaMus (plantsubgenus)|abbreviated=no|linked=yes}}. The disambiguation term can be left unitalicized by using {{para|dab|yes}}. Can these two cases be distinguished automatically?
* "Quoted" genus names are not handled correctly. In {{#invoke:TaxonItalics|main|"Dryosaurus" grandis|abbreviated=no|linked=yes}} and {{#invoke:TaxonItalics|main|"Dryosaurus" grandis|abbreviated=yes|linked=no}}, the double quote marks should ideally not be italicized.
* What about <code><nowiki>{{#invoke:TaxonItalics|main|Felis|abbreviated=yes|linked=no}}</nowiki></code> → {{#invoke:TaxonItalics|main|Felis|abbreviated=yes|linked=no}} – doesn't abbreviate unless it appears to be a binomial.
* If passed a string which is manually wikilinked and italicized, the wrong output is produced: <nowiki>{{#invoke:TaxonItalics|main|[[Cyclamen#Subgenus Cyclamen|''Cyclamen'' subg. ''Cyclamen'']]|abbreviated=no|linked=no}}</nowiki> → {{#invoke:TaxonItalics|main|{{#invoke:TaxonItalics|main|[[Cyclamen#Subgenus Cyclamen|''Cyclamen'' subg. ''Cyclamen'']]|abbreviated=no|linked=no}}}} instead of leaving it unchanged as [[Cyclamen#Subgenus Cyclamen|''Cyclamen'' subg. ''Cyclamen'']].
 
{| class="wikitable"
Line 44 ⟶ 43:
|-
|<nowiki>{{#invoke:TaxonItalics|main|Mus (Mus)|linked=yes}}</nowiki> || {{#invoke:TaxonItalics|main|Mus (Mus)|linked=yes}}|| {{#invoke:TaxonItalics/sandbox|main|Mus (Mus)|linked=yes}}
|-
|<nowiki>{{#invoke:TaxonItalics|main|Caia (plant)|abbreviated=no|linked=yes|dab=yes}}</nowiki> || {{#invoke:TaxonItalics|main|Caia (plant)|abbreviated=no|linked=yes|dab=yes}}|| {{#invoke:TaxonItalics/sandbox|main|Caia (plant)|abbreviated=no|linked=yes|dab=yes}}
|-
|<nowiki>{{#invoke:TaxonItalics|main|Bunyavirales|linked=yes}}</nowiki> || {{#invoke:TaxonItalics|main|Bunyavirales|linked=yes}}|| {{#invoke:TaxonItalics/sandbox|main|Bunyavirales|linked=yes}}
Line 50 ⟶ 51:
|-
|<nowiki>{{#invoke:TaxonItalics|main|Acer tataricum subsp. ginnala|abbreviated=yes|linked=yes}}</nowiki> || {{#invoke:TaxonItalics|main|Acer tataricum subsp. ginnala|abbreviated=yes|linked=yes}}|| {{#invoke:TaxonItalics/sandbox|main|Acer tataricum subsp. ginnala|abbreviated=yes|linked=yes}}
|-
|<nowiki>{{#invoke:TaxonItalics|main|Caia (plant)|abbreviated=no|linked=yes}}</nowiki> || {{#invoke:TaxonItalics|main|Caia (plant)|abbreviated=no|linked=yes}}|| {{#invoke:TaxonItalics/sandbox|main|Caia (plant)|abbreviated=no|linked=yes}}
|-
|<nowiki>{{#invoke:TaxonItalics|main|"Dryosaurus" grandis|abbreviated=yes|linked=yes}}</nowiki> || {{#invoke:TaxonItalics|main|"Dryosaurus" grandis|abbreviated=yes|linked=yes}}|| {{#invoke:TaxonItalics/sandbox|main|"Dryosaurus" grandis|abbreviated=yes|linked=yes}}
|-
|colspan=2|<strong>AlreadyHas hasinternal italic markup at the startremove and/or endprocess as doif nothingabsent</strong>
|-
|<nowiki>{{#invoke:TaxonItalics|main|Pinus ''subg.'' Pinus}}</nowiki> || {{#invoke:TaxonItalics|main|Pinus ''subg.'' Pinus}}|| {{#invoke:TaxonItalics/sandbox|main|Pinus ''subg.'' Pinus}}
|-
|<nowiki>{{#invoke:TaxonItalics|main|Pinus subg.'' Pinus}}</nowiki> || {{#invoke:TaxonItalics|main|Pinus subg.'' Pinus}}|| {{#invoke:TaxonItalics/sandbox|main|Pinus subg.'' Pinus}}
|-
|colspan=2|<strong>HasAlready internalhas italic markup at removethe start and/or processend as ifreturn absentunchanged</strong>
|-
|<nowiki>{{#invoke:TaxonItalics|main|''Pinus sylvestris''}}</nowiki> || {{#invoke:TaxonItalics|main|''Pinus sylvestris''}}|| {{#invoke:TaxonItalics/sandbox|main|''Pinus sylvestris''}}
Line 63 ⟶ 68:
|<nowiki>{{#invoke:TaxonItalics|main|''Pinus subg. Pinus''}}</nowiki> || {{#invoke:TaxonItalics|main|''Pinus subg. Pinus''}}|| {{#invoke:TaxonItalics/sandbox|main|''Pinus subg. Pinus''}}
|-
|<nowiki>{{#invoke:TaxonItalics|main|''Pinus'' '''subg.''' ''Pinus''}}</nowiki> || {{#invoke:TaxonItalics|main|''Pinus'' '''subg.''' ''Pinus''}} || {{#invoke:TaxonItalics/sandbox|main|''Pinus'' '''subg.''' ''Pinus''}}
|-
|<nowiki>{{#invoke:TaxonItalics|main|''Pinus subg. Pinus}} text after''</nowiki> || {{#invoke:TaxonItalics|main|''Pinus subg. Pinus}} text after''|| {{#invoke:TaxonItalics/sandbox|main|''Pinus subg. Pinus}} text after''
|-
|<nowiki>{{#invoke:TaxonItalics|main|Pinus subg. Pinus''}} text after''</nowiki> || {{#invoke:TaxonItalics|main|Pinus subg. Pinus''}} text after''|| {{#invoke:TaxonItalics/sandbox|main|Pinus subg. Pinus''}} text after''
|-
|colspan=2|<strong>Has internal italic markup – remove and process as if absent</strong>
|-
|<nowiki>{{#invoke:TaxonItalics|main|Pinus ''subg.'' Pinus}}</nowiki> || {{#invoke:TaxonItalics|main|Pinus ''subg.'' Pinus}}|| {{#invoke:TaxonItalics/sandbox|main|Pinus ''subg.'' Pinus}}
|-
|<nowiki>{{#invoke:TaxonItalics|main|Pinus subg.'' Pinus}}</nowiki> || {{#invoke:TaxonItalics|main|Pinus subg.'' Pinus}}|| {{#invoke:TaxonItalics/sandbox|main|Pinus subg.'' Pinus}}
|-
|colspan=2|<strong>Starts with [ – return unchanged</strong>
|-
|<nowiki>{{#invoke:TaxonItalics|main|[[Cyclamen#Subgenus Cyclamen|''Cyclamen'' subg. ''Cyclamen'']]}}</nowiki> || {{#invoke:TaxonItalics|main|[[Cyclamen#Subgenus Cyclamen|''Cyclamen'' subg. ''Cyclamen'']]}}|| {{#invoke:TaxonItalics/sandbox|main|[[Cyclamen#Subgenus Cyclamen|''Cyclamen'' subg. ''Cyclamen'']]}}