Closed njmsdk closed 10 years ago
Let me think about this one. It seems like it would be ok, but want to make sure I'm not missing something.
PS> Thanks for including the code to ignore this in compatibility mode!
No problem. Alternatively of you feel it would be safer, it could be implemented as an optional feature switched on using a command line flag such as --escaped-line-breaks.
I have implemented the --enable-line-breaks flag to turn on this syntax extension.
I tweaked the code so that an escaped newline is treated as a regular newline if "--escaped-line-breaks" is not enabled.
Thanks for the code submission!
Sorry, but I have to point out that this notation is counter-intuitive.
Not sure if know about this, but a backslash at the end of a line, e.g. in UNIX shell scripts, is widely accepted to achieve the exact opposite, namely to ignore the newline character, and to indicate that the command/line/paragraph continues as if everything was on the same line.
I would think it should be better to use an explicit "\n" or have some notation at the beginning of the next line. Why not something like:
This is a line.\n
This is a new line.
\nThis is also a new line.
"\n" isn't a good option as it isn't really in the style of Markdown's low markup approach.
I'm honestly not too worried about it, as I suspect that njmsdk may be the only person who will use this feature. But perhaps I'm wrong, and we can come up with another syntax.
And since the default behavior is that this current syntax degrades to a regular line break, which in a Markdown document means don't insert a line break, the default is really the same as the Unix behavior. It's only when this particular command-line option is intentionally added by the user that a line break is inserted. One could think about it as a "don't do the regular thing" option, which sort of makes sense.
I understand the point, but on the other side the escaped line break syntax is also supported by the pandoc markdown version, and I think we should use a common syntax if possible.
If it becomes a problem we can of course always revert the patch.
Hi, I have added support for escaped line breaks, i.e. a backslash followed by a newline is also a hard line break.
This is useful with editors that automatically strip trailing spaces.