Skip to content

Wrong startOffset in HardLineBreak #10

Description

@JFormDesigner

The startOffset in HardLineBreak is wrong in two cases:

a) if using backslash at the end of line, the startOffset does not include the backslash

example from ast_spec.md (line 7332):

foo\
bar
.
<p>foo<br />
bar</p>
.
Document[0, 9]
  Paragraph[0, 9]
    Text[0, 3] chars:[0, 3, "foo"]
    HardLineBreak[4, 5]
    Text[5, 8] chars:[5, 8, "bar"]

HardLineBreak starts at 4, but it should start at 3 where the backslash is.

b) if using more than two space characters at the end of a line, only the last two space characters are included in HardLineBreak, but it would IMO make more sense to include all trailing space characters in HardLineBreak

example from ast_spec.md (line 12564):

foo       
baz
.
<p>foo<br />
baz</p>
.
Document[0, 15]
  Paragraph[0, 15]
    Text[0, 3] chars:[0, 3, "foo"]
    HardLineBreak[8, 11]
    Text[11, 14] chars:[11, 14, "baz"]

HardLineBreak starts at 8, but it should start at 3 where the first trailing space character is

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions