Bug introduced in 7.0 or earlier and persists through 11.0.0
Bug isn't present in version 5.2
Update: Sjoerd pointed out that this happens with any string and it is not related to StringForm. Just evaluate "foo bar \\. daz.". Or type "\\. d directly, and watch the cursor jump after typing the d.
I found the weirdest problem with messages and StringForm.
This works fine:
But let's change that b to a d now:
What is going on? Where did that line break come from?
It turns out that the problem is actually in StringForm.
StringForm["foo bar \\. daz."]
It's a bug and it's there at least in 8.0.4-10.4.1. But can anyone offer an explanation about the cause? Removing either the backslash (remember that \\ denotes a single backslash) or the . or changing the d to something else prevents the problem. It doesn't matter if I use a capital or lowercase d.



0D) is CR. 10 (or0A) is LF. Usingainstead ofdalso triggers the problem.bdoes not. This confirms your theory. – Szabolcs Jun 19 '16 at 13:18"\."produces error messageSyntax::sntoct2: 2 hexadecimal digits are required after \. to construct an 8-bit character.In version 10.4.1 this message is defined (evaluateSyntax::sntoct2) but isn't generated in this case... – Alexey Popkov Jun 19 '16 at 14:23"foo bar \\. daz."produces the expected result but with versions 8.0.4 and 10.4.1 I observe the line break afterd. – Alexey Popkov Jun 19 '16 at 14:29dduring typing"\\. dwith versions 5.2, 8.0.4 and 10.4.1 on Windows 7 x64. But after evaluating"\\. d"I get additional empty line in the output with versions 8.0.4 and 10.4.1 (but not with version 5.2). – Alexey Popkov Jun 19 '16 at 14:36dduring typing"\\\. dwith versions 8.0.4 and 10.4.1 on Windows 7 x64 (but not with version 5.2). Evaluation of"\\\. d"triggers theSyntax::sntoct2message with versions 5.2 and 8.0.4 but not with version 10.4.1. – Alexey Popkov Jun 19 '16 at 14:50"\\\\. d"produces the expected output (i.e.\\. d) with the all versions tested. – Alexey Popkov Jun 19 '16 at 14:54CellPrint@Cell@"\\. d"in version 5.2 prints the cellCell["\n", GeneratedCell->True, CellAutoOverwrite->True]but with versions 8.0.4 and 10.4.1 it printsCell["\\. d", GeneratedCell->True, CellAutoOverwrite->True, CellChangeTimes->{3.6753369642877436`*^9}]which is displayed correctly. – Alexey Popkov Jun 19 '16 at 14:58