diff options
-rw-r--r-- | Pancake/Printing.hs | 9 | ||||
-rw-r--r-- | Pancake/Rendering.hs | 14 | ||||
-rw-r--r-- | pancake.el | 5 |
3 files changed, 11 insertions, 17 deletions
diff --git a/Pancake/Printing.hs b/Pancake/Printing.hs index 04d9de6..c16e820 100644 --- a/Pancake/Printing.hs +++ b/Pancake/Printing.hs @@ -30,12 +30,9 @@ 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 (Strikethrough s) = propertize t s +propertize t (Subscript s) = propertize t s +propertize t (Superscript s) = propertize t s propertize t (Underline s) = fromMaybe id (getCapability t withUnderline) $ propertize t s propertize t (Denote _ s) = propertize t s diff --git a/Pancake/Rendering.hs b/Pancake/Rendering.hs index 2c1823a..075fef0 100644 --- a/Pancake/Rendering.hs +++ b/Pancake/Rendering.hs @@ -209,11 +209,9 @@ unstyled = concatMap unstyled' unstyled' (Underline s) = unstyled' s unstyled' (Bold s) = unstyled' s unstyled' (Emph s) = unstyled' s - -- Better to cut shorter lines than longer ones, so assuming CLI - -- mode. - unstyled' (Strikethrough s) = "-" ++ unstyled' s ++ "-" - unstyled' (Subscript s) = "_{" ++ unstyled' s ++ "}" - unstyled' (Superscript s) = "^{" ++ unstyled' s ++ "}" + unstyled' (Strikethrough s) = unstyled' s + unstyled' (Subscript s) = unstyled' s + unstyled' (Superscript s) = unstyled' s unstyled' (Fg _ s) = unstyled' s unstyled' (Denote _ s) = unstyled' s @@ -287,9 +285,9 @@ readInline (P.Str s) | otherwise = pure [fromString s] readInline (P.Emph s) = concatMap (map Emph) <$> mapM readInline s readInline (P.Strong s) = concatMap (map Bold) <$> mapM readInline s -readInline (P.Strikeout s) = concatMap (map Strikethrough) <$> mapM readInline s -readInline (P.Superscript s) = concatMap (map Superscript) <$> mapM readInline s -readInline (P.Subscript s) = concatMap (map Subscript) <$> mapM readInline s +readInline (P.Strikeout s) = map Strikethrough <$> wrappedInlines "-" "-" s +readInline (P.Superscript s) = map Superscript <$> wrappedInlines "^{" "}" s +readInline (P.Subscript s) = map Subscript <$> wrappedInlines "_{" "}" s readInline (P.SmallCaps s) = wrappedInlines "\\sc{" "}" s readInline (P.Quoted P.SingleQuote s) = wrappedInlines "‘" "’" s readInline (P.Quoted P.DoubleQuote s) = wrappedInlines "“" "”" s @@ -195,11 +195,10 @@ (add-face-text-property start (point) face t)) (`(subscript . ,rest) (pancake-print-line rest) - (add-text-properties start (point) '(display (height 0.75)))) + (add-text-properties start (point) '(display (raise -0.2)))) (`(superscript . ,rest) (pancake-print-line rest) - (add-text-properties start (point) '(display ((raise 0.25) - (height 0.75))))) + (add-text-properties start (point) '(display (raise 0.2)))) (`(denotation (math . ,formula) . ,rest) (pancake-print-line rest)) (`(denotation (link . ,uri) . ,rest) |