From 4b5d0346d4c296003a3d5b5680216357c5939aee Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Thu, 27 Apr 2023 10:43:37 +1200 Subject: [PATCH] Test & fix rendering of Ethiopian 1. --- src/Data/CSS/Preprocessor/Text/CounterStyle.hs | 2 +- test/Test.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Data/CSS/Preprocessor/Text/CounterStyle.hs b/src/Data/CSS/Preprocessor/Text/CounterStyle.hs index c0d8bdd..95e2085 100644 --- a/src/Data/CSS/Preprocessor/Text/CounterStyle.hs +++ b/src/Data/CSS/Preprocessor/Text/CounterStyle.hs @@ -260,7 +260,7 @@ counterRenderCore CounterStyle { markers' = map snd markers -- Following https://w3c.github.io/csswg-drafts/css-counter-styles-3/#ethiopic-numeric-counter-style -- 1. If the number is 1, return "፩" (U+1369). -counterRenderCore CounterStyle { system = Ethiopic, symbols = (sym:_) } 1 = sym +counterRenderCore CounterStyle { system = Ethiopic, symbols = (_:sym:_) } 1 = sym counterRenderCore CounterStyle { system = Ethiopic, symbols = unitSyms, additiveSymbols = tenSyms } x = Txt.concat $ renderPairs True $ diff --git a/test/Test.hs b/test/Test.hs index 35d7042..381f1b9 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -710,6 +710,7 @@ spec = do counterRender 119 `shouldBe` "一百一十九" counterRender 120 `shouldBe` "一百二十" it "Handles ethiopian numbering system" $ do + Ctr.counterRender Ctr.ethiopic 1 `shouldBe` "፩" Ctr.counterRender Ctr.ethiopic 100 `shouldBe` "፻" Ctr.counterRender Ctr.ethiopic 78010092 `shouldBe` "፸፰፻፩፼፺፪" Ctr.counterRender Ctr.ethiopic 780100000092 `shouldBe` "፸፰፻፩፼፼፺፪" -- 2.30.2