add archiphoneme span

This commit is contained in:
Rhiannon Morris 2021-06-04 05:35:17 +02:00
parent 2c522aa4b0
commit 90127bba96

View file

@ -15,12 +15,14 @@ spans = \case
Code attrs txt
| Just ('\\', txt') <- Text.uncons txt -> pure $ Code attrs txt'
| Just _ <- enclosed '/' '/' txt -> pure $ ipaB txt
| Just txt' <- enclosed '⫽' '⫽' txt -> pure $ ipaA txt'
| Just _ <- enclosed '[' ']' txt -> pure $ ipaN txt
| Just txt' <- enclosed '{' '}' txt -> lang txt'
| Just txt' <- enclosed '!' '!' txt -> pure $ abbr txt'
i -> pure i
ipaB, ipaN, abbr :: Text -> Inline
ipaA, ipaB, ipaN, abbr :: 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