On Thursday, 18 July 2019 at 11:38:55 UTC, Paul wrote:
What is the solution in D for wysiwyg strings (or similar) spanning multiple lines containing quotes and apostrophes?

Take a look at:
https://dlang.org/spec/lex.html#string_literals

All string literals may span multiple lines.

If you only need " and ' without `, you can use a string literal like this: `WysiwygCharacters`

For ' and ` in your string you can use r"WysiwygCharacters".

You can also concatenate different string literals with ~.

If your string contains code, you can try a token string like q{if 'a' "" ``}

Finally, you can also have custom delimiters in q-strings but I don't recommend them since they're hard to process for text editors. (Details are in the spec)

(also, how can I put formatted code in a post?)

Often requested, but you can't.

Reply via email to