add <mark> syntax *hello*
This commit is contained in:
parent
abd27eebe9
commit
1136cff702
1 changed files with 4 additions and 2 deletions
|
@ -20,13 +20,15 @@ spans = \case
|
||||||
| Just _ <- enclosed "[" "]" txt -> pure $ ipaN txt
|
| Just _ <- enclosed "[" "]" txt -> pure $ ipaN txt
|
||||||
| 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'
|
||||||
i -> pure i
|
i -> pure i
|
||||||
|
|
||||||
ipaA, ipaB, ipaN, abbr :: Text -> Inline
|
ipaA, ipaB, ipaN, abbr, mark :: Text -> Inline
|
||||||
ipaA = Span (cls ["ipa", "ipa-arch"]) . text' . surround "⫽"
|
ipaA = Span (cls ["ipa", "ipa-arch"]) . text' . surround "⫽"
|
||||||
ipaB = Span (cls ["ipa", "ipa-broad"]) . text'
|
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>"
|
||||||
|
|
||||||
surround :: Text -> Text -> Text
|
surround :: Text -> Text -> Text
|
||||||
surround s txt = s <> txt <> s
|
surround s txt = s <> txt <> s
|
||||||
|
|
Loading…
Reference in a new issue