From 1d8a5140e3ce03d9fa6b9c63a6621ab3ab64eb4c Mon Sep 17 00:00:00 2001 From: defanor Date: Tue, 7 Nov 2017 21:37:54 +0300 Subject: Let Emacs to render subscripts, superscripts, strikethrough That is, add `Styled` constructors for those. --- Pancake/Printing.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Pancake/Printing.hs') diff --git a/Pancake/Printing.hs b/Pancake/Printing.hs index 66d2606..9bc6c81 100644 --- a/Pancake/Printing.hs +++ b/Pancake/Printing.hs @@ -30,6 +30,12 @@ propertize t (Bold s) = fromMaybe id (getCapability t withBold) $ propertize t s propertize t (Emph s) = fromMaybe id (getCapability t withStandout) $ propertize t s +propertize t (Strikethrough s) = + mconcat [termText "-", propertize t s, termText "-"] +propertize t (Subscript s) = + mconcat [termText "_{", propertize t s, termText "}"] +propertize t (Superscript s) = + mconcat [termText "^{", propertize t s, termText "}"] propertize t (Underline s) = fromMaybe id (getCapability t withUnderline) $ propertize t s propertize t (Denote _ s) = propertize t s @@ -78,6 +84,9 @@ showSexps uri ro = showSexp (Bold s) = list ["style", "bold", showSexp s] showSexp (Underline s) = list ["style", "underline", showSexp s] showSexp (Emph s) = list ["style", "italic", showSexp s] + showSexp (Strikethrough s) = list ["style", "strikethrough", showSexp s] + showSexp (Subscript s) = list ["subscript", showSexp s] + showSexp (Superscript s) = list ["superscript", showSexp s] showSexp (Denote d s) = list [ "denotation" , showDenotation d , showSexp s] -- cgit v1.2.3