~alcinnz/CatTrap

15bde40d0ae45f20e01b8228103ffba6345e028d — Adrian Cochrane 1 year, 8 months ago 9efd1ba
Capture length of spans when lowering runs of inlines.
1 files changed, 2 insertions(+), 1 deletions(-)

M Graphics/Layout/Inline/CSS.hs
M Graphics/Layout/Inline/CSS.hs => Graphics/Layout/Inline/CSS.hs +2 -1
@@ 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)