commands: escape chars in macro stringification

This commit is contained in:
hellerve 2018-08-08 15:41:11 +02:00
parent b1ee9ac07f
commit 5aa31aa0cb

View File

@ -684,7 +684,10 @@ commandStr :: CommandCallback
commandStr xs =
return (Right (XObj (Str (join (map f xs))) (Just dummyInfo) (Just StringTy)))
where f (XObj (Str s) _ _) = s
f x = pretty x
f x = escape $ pretty x
escape [] = []
escape ('\\':y) = "\\\\" ++ escape y
escape (x:y) = x : escape y
commandNot :: CommandCallback
commandNot [x] =