From 15bde40d0ae45f20e01b8228103ffba6345e028d Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Fri, 17 Mar 2023 13:37:30 +1300 Subject: [PATCH] Capture length of spans when lowering runs of inlines. --- Graphics/Layout/Inline/CSS.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Graphics/Layout/Inline/CSS.hs b/Graphics/Layout/Inline/CSS.hs index 1f16f35..28f6419 100644 --- a/Graphics/Layout/Inline/CSS.hs +++ b/Graphics/Layout/Inline/CSS.hs @@ -33,7 +33,8 @@ instance PropertyParser CSSInline where data ParagraphBuilder = ParagraphBuilder Lz.Text [Span] buildParagraph :: CSSInline -> ParagraphBuilder -buildParagraph (CSSInline txt opts) = ParagraphBuilder txt [Span 0 opts] +buildParagraph (CSSInline txt opts) = + ParagraphBuilder txt [flip Span opts $ fromEnum $ Lz.length txt] concatParagraph :: ParagraphBuilder -> ParagraphBuilder -> ParagraphBuilder concatParagraph (ParagraphBuilder aTxt aOpts) (ParagraphBuilder bTxt bOps) = ParagraphBuilder (aTxt `Lz.append` bTxt) -- 2.30.2