Skip to content

Commit

Permalink
Small changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Jan 7, 2025
1 parent 829eca4 commit 5505469
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions skylighting-format-typst/src/Skylighting/Format/Typst.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Data.Text (Text)
import qualified Data.Text as Text
import Skylighting.Types
import qualified Data.Map as M
import Data.Maybe (fromMaybe)
#if !MIN_VERSION_base(4,11,0)
import Data.Semigroup
#endif
Expand Down Expand Up @@ -86,9 +87,7 @@ macrodef :: Maybe Color -> [(TokenType, TokenStyle)] -> TokenType -> Text
macrodef defaultcol tokstyles' tokt =
"#let " <> Text.pack (show tokt) <> "(s) = " <> (ul . bg . textstyle) ("raw(s)")
where tokstyles = M.fromList tokstyles'
tokf = case M.lookup tokt tokstyles of
Nothing -> defStyle
Just x -> x
tokf = fromMaybe defStyle $ M.lookup tokt tokstyles
ul x = if tokenUnderline tokf
then "underline(" <> x <> ")"
else x
Expand Down

0 comments on commit 5505469

Please sign in to comment.