Skip to content

arowM/elm-multiline-string

Repository files navigation

elm-multiline-string

test Elm package

Tiny library to solve multiline string indentation problems.

import String.Multiline exposing (here)

conventional : String
conventional =
    let
        part = """This multiline string
breaks indents..."""
    in
    part


conventional2 : String
conventional2 =
    let
        part =
            """
            This multiline string
            has unexpected 12 spaces and newlines. 😢
            """
    in
    part

conventional2
--> "\n            This multiline string\n            has unexpected 12 spaces and newlines. 😢\n            "


cool : String
cool =
    let
        part =
            here """
            This multiline string does not
            have unexpected spaces and newlines.
            """
    in
    part

cool
--> "This multiline string does not\nhave unexpected spaces and newlines."


cool2 : String
cool2 =
    let
        part =
            here """
                This line is indented.
            This line is not.
                This line is also indented.
            """
    in
    part

cool2
--> "    This line is indented.\nThis line is not.\n    This line is also indented."

About

Tiny library to solve multiline string indentation problems.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages