From a9e98f5a054822c671d7e64ab7e5ad47fcdbc446 Mon Sep 17 00:00:00 2001 From: mark-sil <83427558+mark-sil@users.noreply.github.com> Date: Tue, 24 Mar 2026 14:07:08 -0400 Subject: [PATCH] LT-22456: Fix sense number 'after' content for multiple ws MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed the Flex display so that before/after content on the sense numbers on main entries is now displayed the same as it is for subentries. To get the display that we want on the second sense number, the user will need to add “) “ to the after content for this node: Main Entry -> Senses -> Sense Number Adding this will also cause the “) “ to be added to the Word Export output, so no change to the Word Export code was needed. Note that the project where this problem existed had a custom Configuration, additional ‘Sense Number’ fields were added. --- Src/xWorks/CssGenerator.cs | 2 +- Src/xWorks/xWorksTests/CssGeneratorTests.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Src/xWorks/CssGenerator.cs b/Src/xWorks/CssGenerator.cs index 9fd87fb7ff..d58c2876ee 100644 --- a/Src/xWorks/CssGenerator.cs +++ b/Src/xWorks/CssGenerator.cs @@ -450,7 +450,7 @@ private static List GenerateCssForSenses(ConfigurableDictionaryNode c // Not using SelectClassName here; sense and sensenumber are siblings and the configNode is for the Senses collection. // Select the base plus the node's unmodified class attribute and append the sensenumber matcher. - var senseNumberSelector = string.Format("{0} .sensenumber", senseContentSelector); + var senseNumberSelector = string.Format("{0} > .sensenumber", senseContentSelector); senseNumberRule.Value = senseNumberSelector; if(!String.IsNullOrEmpty(senseOptions.NumberStyle)) diff --git a/Src/xWorks/xWorksTests/CssGeneratorTests.cs b/Src/xWorks/xWorksTests/CssGeneratorTests.cs index ed315ac206..895cd83559 100644 --- a/Src/xWorks/xWorksTests/CssGeneratorTests.cs +++ b/Src/xWorks/xWorksTests/CssGeneratorTests.cs @@ -2337,7 +2337,7 @@ public void GenerateCssForConfiguration_SenseNumberCharStyleWorks() PopulateFieldsForTesting(entry); // SUT var cssResult = CssGenerator.GenerateCssFromConfiguration(model, m_propertyTable); - VerifyRegex(cssResult, @"\s*\.senses\s*>\s*\.sensecontent\s*\.sensenumber", "sense number style selector was not generated."); + VerifyRegex(cssResult, @"\s*\.senses\s*>\s*\.sensecontent\s*>\s*\.sensenumber", "sense number style selector was not generated."); VerifyFontInfoInCss(FontColor, FontBGColor, FontName, FontBold, FontItalic, FontSize, cssResult); } @@ -2391,7 +2391,7 @@ public void GenerateCssForConfiguration_ReversalSenseNumberWorks() // SUT var cssResult = CssGenerator.GenerateCssFromConfiguration(model, m_propertyTable); VerifyRegex(cssResult, @"^.gloss\s*{\s*font-family", "Gloss with style was not generated from reversal sense"); - VerifyRegex(cssResult, @"^\.refdsenses\s*>\s*\.sensecontent\s*\.sensenumber\s*{.*font-style\s*:\s*italic;.*}", "Sense Number missing"); + VerifyRegex(cssResult, @"^\.refdsenses\s*>\s*\.sensecontent\s*>\s*\.sensenumber\s*{.*font-style\s*:\s*italic;.*}", "Sense Number missing"); } [Test] @@ -2414,8 +2414,8 @@ public void GenerateCssForConfiguration_SenseNumberBeforeAndAfterWork() PopulateFieldsForTesting(entry); // SUT var cssResult = CssGenerator.GenerateCssFromConfiguration(model, m_propertyTable); - VerifyRegex(cssResult, @"\s*\.senses\s*>\s*\.sensecontent\s*\.sensenumber:before{.*content:'\['.*}", "Before content not applied to the sense number selector."); - VerifyRegex(cssResult, @"\s*\.senses\s*>\s*\.sensecontent\s*\.sensenumber:after{.*content:'\]'.*}", "After content not applied to the sense number selector."); + VerifyRegex(cssResult, @"\s*\.senses\s*>\s*\.sensecontent\s*>\s*\.sensenumber:before{.*content:'\['.*}", "Before content not applied to the sense number selector."); + VerifyRegex(cssResult, @"\s*\.senses\s*>\s*\.sensecontent\s*>\s*\.sensenumber:after{.*content:'\]'.*}", "After content not applied to the sense number selector."); } [Test]