Skip to content

Commit 5505469

Browse files
committed
Small changes.
1 parent 829eca4 commit 5505469

File tree

1 file changed

+2
-3
lines changed
  • skylighting-format-typst/src/Skylighting/Format

1 file changed

+2
-3
lines changed

skylighting-format-typst/src/Skylighting/Format/Typst.hs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Data.Text (Text)
1414
import qualified Data.Text as Text
1515
import Skylighting.Types
1616
import qualified Data.Map as M
17+
import Data.Maybe (fromMaybe)
1718
#if !MIN_VERSION_base(4,11,0)
1819
import Data.Semigroup
1920
#endif
@@ -86,9 +87,7 @@ macrodef :: Maybe Color -> [(TokenType, TokenStyle)] -> TokenType -> Text
8687
macrodef defaultcol tokstyles' tokt =
8788
"#let " <> Text.pack (show tokt) <> "(s) = " <> (ul . bg . textstyle) ("raw(s)")
8889
where tokstyles = M.fromList tokstyles'
89-
tokf = case M.lookup tokt tokstyles of
90-
Nothing -> defStyle
91-
Just x -> x
90+
tokf = fromMaybe defStyle $ M.lookup tokt tokstyles
9291
ul x = if tokenUnderline tokf
9392
then "underline(" <> x <> ")"
9493
else x

0 commit comments

Comments
 (0)