From f2f8a1e2fef4ea1a6d157408c967379b45d6af8b Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 11 Jun 2021 23:50:00 -0700 Subject: [PATCH] Markdown: support `\` EOL to generate a `
` Improve compatibility with some other markdown renderers and translate a backslash (`\`) at the very end of a line (a line that is *not* inside a table or code block) into a `
` in addition to the two-or-more-spaces at the end of line translation that already takes place and does the same thing. As expected, the backslash can be escaped by doubling it to preserve it (or by enclosing it in backquotes `\` to make it a code span). Signed-off-by: Kyle J. McKay --- Markdown.pl | 1 + syntax.md | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Markdown.pl b/Markdown.pl index 8154247..6336bc8 100755 --- a/Markdown.pl +++ b/Markdown.pl @@ -1801,6 +1801,7 @@ sub _RunSpanGamut { # Do hard breaks: $text =~ s/ {3,}(\n|\z)/
` tag. When you *do* want to insert a `
` break tag using Markdown, you end a line with two or more spaces, then type return. +Alternatively, a line ending with a backslash `\` that's at the very end +of the line (that's not inside a table or code block) will also translate +into a `
` tag (the `\` is replaced). To keep a literal `\` at the +end of a line (that's not inside a table or code block), double it. + If you end a line with three or more spaces then a `
` tag will be generated instead of the plain `
` tag.