You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is too bad because it makes it less convenient to embed Markdown with fenced code blocks, where each of the 6 backquotes per fenced code block would need to be duplicated.
I get the idea that raw strings are pretty new and that's why this hasn't been noticed yet. I definitely think it should preserve newlines, so the code should be updated rather than the docs. I also think because it's new and has been documented like this, it ought to be OK to put it in a minor release. It probably shouldn't go into a patch release because it's definitely a change of behavior.
The text was updated successfully, but these errors were encountered:
I noticed that raw strings aren't copying the newlines as is suggested in the docs. The relevant code seems to be here: https://github.com/rhaiscript/rhai/blob/main/src/tokenizer.rs#L1265
The docs suggesting it does preserve the newlines: https://rhai.rs/book/ref/strings-chars.html#raw-strings
Reproducing this behavior with
rhai-run
, installed withcargo install rhai
:Note that Helloworld is just one word, not separated by newlines.
An example with backquotes where the newlines are preserved:
This is too bad because it makes it less convenient to embed Markdown with fenced code blocks, where each of the 6 backquotes per fenced code block would need to be duplicated.
I get the idea that raw strings are pretty new and that's why this hasn't been noticed yet. I definitely think it should preserve newlines, so the code should be updated rather than the docs. I also think because it's new and has been documented like this, it ought to be OK to put it in a minor release. It probably shouldn't go into a patch release because it's definitely a change of behavior.
The text was updated successfully, but these errors were encountered: