From 7180cd9c4b113eaa4fe0c3d48a43e50c8399a877 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 11 Aug 2026 17:20:32 -0500 Subject: [PATCH] Read only the numbered entry's fields off a character article MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A character article covers a whole career, and a spin-off's fields sit right beside the numbered entry's. The release prefix was an open wildcard, so whichever came first won: Ashe and Penelo were Revenant Wings jobs ("xiirw job"), Auron's abilities were X-2's Creature Creator movelist ("x2 cc abilities") rather than Bushido, Zack carried a weapon out of Crisis Core ("viicc weapon") for a game he is not playable in, and Dark Kain and Golbez held The After Years data ("ivtay"). Only a mainline tag is admitted now — ffvii, and the remakes ffviir and ffviir2, which are still that entry. It subsumes the "ultimate weapon" guard, since a qualifier is not a mainline tag either, and a stated "None" is treated as no value rather than stored. Two more fixes found the same way, as markup sitting in live values: - editor comments were not stripped, and the unterminated form is the normal case here because the comment opens on the field's line and closes further down the article. Final Fantasy XV's Y'jhimei had an occupation of "", "", RegexOptions.Singleline); + value = Regex.Replace(value, @" Florist", "Florist")] + [InlineData("|occupation=Florist", "Florist")] + public void StripsEditorComments(string line, string? expected) + { + Assert.Equal(expected, + WikiClient.ParseInfoboxField("{{infobox character\n" + line + "\n}}", "occupation")); + } + + [Fact] + public void TreatsAStatedNoneAsNoValue() + { + Assert.Null(WikiClient.ParseCharacterField("{{infobox character\n|job=None\n}}", "job")); + } + [Fact] public void UnwrapsWikilinksToTheirDisplayText() {