Tiramisu Docs

Basics

Strings & Escaping

Handle special characters in Tiramisu with quoting, backslash escaping, and multi-quote strings.

Tiramisu provides several ways to handle special characters in your content. Understanding quoting and escaping is essential for writing content that contains commas, equals signs, brackets, or quotes.

Quoting with Double Quotes

Wrap text in double quotes to prevent special characters from being parsed:

tiramisu
func { "text with, commas and = signs" }

Inside quotes, commas don't split parameters and equals signs don't create named parameters.

Escaping Quotes

The simplest way to include a double quote inside a string is with a backslash:

tiramisu
func { "text with \\"quotes\\" inside" }

Alternatively, use multiple quote characters to wrap the string. The outer pair uses more quotes than any sequence inside:

tiramisu
func { ""text with "quotes" inside"" }

For text that contains double-double quotes, use triple quotes:

tiramisu
func { """text with ""double quotes"" """ }

Backslash Escaping

For individual special characters inside function parameters, use backslash escaping:

EscapeResultPurpose
\,,Prevents parameter separation
\==Prevents named parameter parsing
\{{Prevents function call parsing
\}}Prevents closing a function call
\[[Prevents array parsing
\]]Prevents closing an array
backslash + quotea double quoteEscapes a quote inside a quoted string
\namename { ... }Prevents function call — treats name as literal text

When to Use What

Examples:

tiramisu
// Single comma - backslash is easiest
func { hello\, world }

// Multiple special chars - quotes are cleaner
func { "text with, commas and = signs" }

// Text with quotes - use double-double quotes
func { ""She said "hello""" }

Common Patterns

Math formulas with equals signs:

tiramisu
math { "E = mc^2" }

Code snippets with special characters:

tiramisu
codeblock { language = javascript, "const obj = { key: 'value' };" }

URLs with query parameters:

tiramisu
link { url = "https://example.com/search?q=hello&lang=en", Search }