Fix a few bugs with encoding / decoding strings
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
a1ae15d84c
commit
905b760dd7
|
@ -18,7 +18,7 @@ encodeStr s =
|
|||
let
|
||||
go l =
|
||||
case l of
|
||||
'\\' :: xs -> '\\' :: go xs
|
||||
'\\' :: xs -> '\\' :: '\\' :: go xs
|
||||
'"' :: xs -> '\\' :: '"' :: go xs
|
||||
x :: xs -> x :: go xs
|
||||
[] -> []
|
||||
|
@ -31,6 +31,8 @@ encodeLatex s =
|
|||
go l =
|
||||
case l of
|
||||
'\\' :: xs -> String.toList "\\textbackslash " ++ go xs
|
||||
'{' :: xs -> '\\' :: '{' :: go xs
|
||||
'}' :: xs -> '\\' :: '}' :: go xs
|
||||
x :: xs -> x :: go xs
|
||||
[] -> []
|
||||
in
|
||||
|
|
Loading…
Reference in New Issue
Block a user