Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Literal strings #11

Open
pnathan opened this issue Nov 10, 2014 · 1 comment
Open

Literal strings #11

pnathan opened this issue Nov 10, 2014 · 1 comment
Labels

Comments

@pnathan
Copy link
Owner

pnathan commented Nov 10, 2014

snip from the spec

TOML supports literal strings where there is no escaping allowed at all.
+**Literal strings** are surrounded by single quotes. Like basic strings, they
+must appear on a single line:
+
+```toml
+# What you see is what you get.
+winpath  = 'C:\Users\nodejs\templates'
+winpath2 = '\\ServerX\admin$\system32\'
+quoted   = 'Tom "Dubs" Preston-Werner'
+regex    = '<\i\c*\s*>'
+```
+
+Since there is no escaping, there is no way to write a single quote inside a
+literal string enclosed by single quotes. Luckily, TOML supports a multi-line
+version of literal strings that solves this problem. **Multi-line literal
+strings** are surrounded by three single quotes on each side and allow newlines.
+Like literal strings, there is no escaping whatsoever. If the first character
+after the opening delimiter is a newline (`0x0A`), then it is trimmed. All other
+content between the delimiters is interpreted as-is without modification.
@pnathan pnathan added this to the TOML v0.3.0 milestone Nov 10, 2014
@pnathan pnathan removed this from the TOML v0.3.0 milestone Oct 9, 2021
@pnathan
Copy link
Owner Author

pnathan commented Oct 9, 2021

""" and ''' strings exist - "basic" and 'literal'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant