File tree 1 file changed +2
-3
lines changed
skylighting-format-typst/src/Skylighting/Format
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import Data.Text (Text)
14
14
import qualified Data.Text as Text
15
15
import Skylighting.Types
16
16
import qualified Data.Map as M
17
+ import Data.Maybe (fromMaybe )
17
18
#if !MIN_VERSION_base(4,11,0)
18
19
import Data.Semigroup
19
20
#endif
@@ -86,9 +87,7 @@ macrodef :: Maybe Color -> [(TokenType, TokenStyle)] -> TokenType -> Text
86
87
macrodef defaultcol tokstyles' tokt =
87
88
" #let " <> Text. pack (show tokt) <> " (s) = " <> (ul . bg . textstyle) (" raw(s)" )
88
89
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
92
91
ul x = if tokenUnderline tokf
93
92
then " underline(" <> x <> " )"
94
93
else x
You can’t perform that action at this time.
0 commit comments