From ccc4ce28cc9077d77a0bc9e72b1177eba1be7186 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sun, 28 Apr 2019 21:06:36 +0100 Subject: consistent invalid escape sequence behaviour * docs: document unrecognized escape sequence behaviour [skip ci] Document that unrecognized escape sequence behaviour is like python, not C. * Don't try to decode invalid hex escape sequences Don't try to decode escape sequences which should contain a sequence of hex digits, but don't, throwing a python exception. These will treated literally instead. * Extend test case to cover invalid escape sequences --- docs/markdown/Syntax.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/markdown/Syntax.md') diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md index cf56dd3..aadb14a 100644 --- a/docs/markdown/Syntax.md +++ b/docs/markdown/Syntax.md @@ -116,6 +116,9 @@ The full list of escape sequences is: As in python and C, up to three octal digits are accepted in `\ooo`. +Unrecognized escape sequences are left in the string unchanged, i.e., the +backslash is left in the string. + #### String concatenation Strings can be concatenated to form a new string using the `+` symbol. -- cgit v1.1