diff --git a/create-dependency/src/DependencyCreator.elm b/create-dependency/src/DependencyCreator.elm index f8253d22..0f038272 100644 --- a/create-dependency/src/DependencyCreator.elm +++ b/create-dependency/src/DependencyCreator.elm @@ -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