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