We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8b92aa commit 430f1dcCopy full SHA for 430f1dc
2 files changed
src/Text/TeXMath/Writers/Typst.hs
@@ -84,13 +84,14 @@ esc t =
84
85
escInQuotes :: Text -> Text
86
escInQuotes t =
87
- if T.any (== '"') t
+ if T.any needsEscape t
88
then T.concatMap escapeChar t
89
else t
90
where
91
escapeChar c
92
- | c == '"' = "\\" <> T.singleton c
+ | needsEscape c = "\\" <> T.singleton c
93
| otherwise = T.singleton c
94
+ needsEscape c = c == '\\' || c == '"'
95
96
writeExpS :: Exp -> Text
97
writeExpS (EGrouped es) = "(" <> writeExps es <> ")"
test/regression/245a.test
@@ -0,0 +1,4 @@
1
+<<< native
2
+[ EText TextNormal "\\tau" ]
3
+>>> typst
4
+upright("\\tau")
0 commit comments