add <dfn> markup

This commit is contained in:
Rhiannon Morris 2024-09-26 01:39:24 +02:00
parent 99f4d7eac0
commit 3cd2c59be2

View file

@ -21,6 +21,7 @@ spans = \case
| Just txt' <- enclosed "{" "}" txt -> lang txt' | Just txt' <- enclosed "{" "}" txt -> lang txt'
| Just txt' <- enclosed "!" "!" txt -> pure $ abbr txt' | Just txt' <- enclosed "!" "!" txt -> pure $ abbr txt'
| Just txt' <- enclosed "*" "*" txt -> pure $ mark txt' | Just txt' <- enclosed "*" "*" txt -> pure $ mark txt'
| Just txt' <- enclosed "@" "@" txt -> pure $ dfn txt'
i -> pure i i -> pure i
ipaA, ipaB, ipaN, abbr, mark :: Text -> Inline ipaA, ipaB, ipaN, abbr, mark :: Text -> Inline
@ -29,6 +30,7 @@ ipaB = Span (cls ["ipa", "ipa-broad"]) . text'
ipaN = Span (cls ["ipa", "ipa-narrow"]) . text' ipaN = Span (cls ["ipa", "ipa-narrow"]) . text'
abbr = Span (cls ["abbr"]) . text' . endash abbr = Span (cls ["abbr"]) . text' . endash
mark txt = RawInline "html" $ "<mark>" <> txt <> "</mark>" mark txt = RawInline "html" $ "<mark>" <> txt <> "</mark>"
dfn txt = RawInline "html" $ "<dfn>" <> txt <> "</dfn>"
surround :: Text -> Text -> Text surround :: Text -> Text -> Text
surround s txt = s <> txt <> s surround s txt = s <> txt <> s