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 \\

  • diff --git a/org/testdata/inline.org b/org/testdata/inline.org index 7097358..d967879 100644 --- a/org/testdata/inline.org +++ b/org/testdata/inline.org @@ -1,5 +1,6 @@ - /emphasis/ and a hard line break \\ - see? + see? \\ + also hard line breaks not followed by a newline get ignored, see \\ - /.emphasis with dot border chars./ - /emphasis with a slash/inside/ - /emphasis/ followed by raw text with slash / diff --git a/org/testdata/inline.pretty_org b/org/testdata/inline.pretty_org index f4429e9..f1320bb 100644 --- a/org/testdata/inline.pretty_org +++ b/org/testdata/inline.pretty_org @@ -1,5 +1,6 @@ - /emphasis/ and a hard line break \\ - see? + see? \\ + also hard line breaks not followed by a newline get ignored, see \\ - /.emphasis with dot border chars./ - /emphasis with a slash/inside/ - /emphasis/ followed by raw text with slash /