diff --git a/org/inline.go b/org/inline.go index d4c8c43..ab58b7b 100644 --- a/org/inline.go +++ b/org/inline.go @@ -129,7 +129,7 @@ func (d *Document) parseLineBreak(input string, start int) (int, Node) { } func (d *Document) parseExplicitLineBreak(input string, start int) (int, Node) { - if start == 0 || input[start-1] == '\n' || start+1 >= len(input) || input[start+1] != '\\' { + if start == 0 || input[start-1] == '\n' || start+2 >= len(input) || input[start+1] != '\\' { return 0, nil } for i := start + 2; unicode.IsSpace(rune(input[i])); i++ { diff --git a/org/testdata/inline.html b/org/testdata/inline.html index 3cbb95b..9801b36 100644 --- a/org/testdata/inline.html +++ b/org/testdata/inline.html @@ -2,7 +2,8 @@
emphasis and a hard line break
-see?
+see?
+also hard line breaks not followed by a newline get ignored, see \\