diff --git a/langfilter/Spans.hs b/langfilter/Spans.hs index 3da9a30..7d1fbfe 100644 --- a/langfilter/Spans.hs +++ b/langfilter/Spans.hs @@ -13,20 +13,22 @@ import qualified Data.Text as Text spans :: Vars => Inline -> IO Inline spans = \case Code attrs txt - | Just ('\\', txt') <- Text.uncons txt -> pure $ Code attrs txt' + | Just ('\\', txt') <- Text.uncons txt -> pure $ Code attrs txt' | Just txt' <- enclosed "⫽" "⫽" txt -> pure $ ipaA txt' | Just txt' <- enclosed "//" "//" txt -> pure $ ipaA txt' | Just _ <- enclosed "/" "/" txt -> pure $ ipaB txt | Just _ <- enclosed "[" "]" txt -> pure $ ipaN txt | Just txt' <- enclosed "{" "}" txt -> lang txt' | Just txt' <- enclosed "!" "!" txt -> pure $ abbr txt' + | Just txt' <- enclosed "*" "*" txt -> pure $ mark txt' i -> pure i -ipaA, ipaB, ipaN, abbr :: Text -> Inline +ipaA, ipaB, ipaN, abbr, mark :: Text -> Inline ipaA = Span (cls ["ipa", "ipa-arch"]) . text' . surround "⫽" ipaB = Span (cls ["ipa", "ipa-broad"]) . text' ipaN = Span (cls ["ipa", "ipa-narrow"]) . text' abbr = Span (cls ["abbr"]) . text' . endash +mark txt = RawInline "html" $ "" <> txt <> "" surround :: Text -> Text -> Text surround s txt = s <> txt <> s