Process multiline strings in Elm, removing unwanted indentation and providing flexible formatting options, similar to C# Raw String Literals or Java Text Blocks.
Ideal for generating clean SQL queries, email templates, HTML, or Markdown.
Default configuration for text block processing.
Use as-is or customize fields, e.g., { defaultOptions | indent = 2, indentChar = '.' }.
Process a multiline string with default options, removing unwanted leading indentation.
textBlock
"""
<div>
<p>Hello</p>
</div>
"""
-- "<div>\n <p>Hello</p>\n</div>"Supports backslash (\) for newline escaping and pipe (|) for preserving trailing spaces.
Process a multiline string with custom options.
textBlockWith { defaultOptions | indent = 2, indentChar = '.' }
"""
<div>
<p>Hello</p>
</div>
"""
-- "..<div>\n.. <p>Hello</p>\n..</div>"Supports backslash (\) for newline escaping and pipe (|) for preserving trailing spaces.
Process a multiline string with custom options and replace placeholders with values.
textBlockWithFormat defaultOptions
[ ( "name", "World" ) ]
"""
Hello {{name}}!
"""
-- "Hello World!"Placeholders are defined by templateValueStart and templateValueEnd in TextBlockOptions.
Configuration options for text block processing.
indent: Number of indentation characters to add to each line (default: 0).indentChar: Character used for indentation (default: space).newline: String used for line breaks (default: "\n").templateValueStart: Start delimiter for interpolation placeholders (default: "{{").templateValueEnd: End delimiter for interpolation placeholders (default: "}}").