mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Use triple-quotes only when necessary
This commit is contained in:
parent
ce43a5e627
commit
ee98647bcf
@ -68,7 +68,18 @@ formatAlias alias_ =
|
||||
|
||||
stringify : String -> String
|
||||
stringify s =
|
||||
"\"\"\"" ++ String.replace "\"\"\"" """\\"\\"\\""" s ++ "\"\"\""
|
||||
s
|
||||
|> String.replace "\"" "\\\""
|
||||
|> wrapInQuotes
|
||||
|
||||
|
||||
wrapInQuotes : String -> String
|
||||
wrapInQuotes s =
|
||||
if String.contains "\n" s then
|
||||
"\"\"\"" ++ s ++ "\"\"\""
|
||||
|
||||
else
|
||||
"\"" ++ s ++ "\""
|
||||
|
||||
|
||||
listOfThings : (a -> String) -> List a -> String
|
||||
|
Loading…
Reference in New Issue
Block a user