trim whitespace around the svg. lol

This commit is contained in:
Rhiannon Morris 2024-11-30 20:03:19 +01:00
parent a7bbfd5035
commit e8d46973fa

View file

@ -13,6 +13,7 @@ import Data.Text (Text)
import qualified Data.Text as Text import qualified Data.Text as Text
import qualified Data.Text.Lazy as Lazy import qualified Data.Text.Lazy as Lazy
import qualified Laantas import qualified Laantas
import Data.Char (isSpace)
data Item = data Item =
@ -86,9 +87,10 @@ makeItem :: Item -> Inline
makeItem (Item {..}) = makeItem (Item {..}) =
let env = Laantas.E {..} let env = Laantas.E {..}
words = Laantas.split text in words = Laantas.split text in
RawInline "html" $ Lazy.toStrict $ Laantas.prettyText $ RawInline "html" $
Laantas.doGlyphsNoDoctype words env `Laantas.with` Lazy.toStrict $ Lazy.dropAround isSpace $ Laantas.prettyText $
[Laantas.Class_ Laantas.<<- "scr"] Laantas.doGlyphsNoDoctype words env `Laantas.with`
[Laantas.Class_ Laantas.<<- "scr"]
notPunc :: Char -> Bool notPunc :: Char -> Bool
notPunc c = c `notElem` ("{}·" :: String) notPunc c = c `notElem` ("{}·" :: String)