Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception wrapping blank line in index #587

Merged

Conversation

windymilla
Copy link
Collaborator

For normal wrapping, the blank line is taken as a paragraph so is not itself wrapped. However, because indexes have been formatted into single whole lines, they are wrapped one line at a time. This accidentally included wrapping the blank lines. The wrapping routine hadn't been written to expect wrapping an empty string.

  1. In lower wrapping routine, deal with an empty paragraph without raising an exception.
  2. In upper index wrapping routine, only wrap lines that have text

Finally, while testing, I found an independent bug (of mine) which probably wouldn't occur in RL. I made a small index by deleting most of the lines from the example supplied, which left some page marks at the start of the closing I/ line. It then failed to recognize this as the end of the index, and said "no match for opening /I". Fixed.

Fixes #585

For normal wrapping, the blank line is taken as a paragraph
so is not itself wrapped. However, because indexes have
been formatted into single whole lines, they are wrapped
one line at a time. This accidentally included wrapping the
blank lines. The wrapping routine hadn't been written to
expect wrapping an empty string.

1. In lower wrapping routine, deal with an empty paragraph
without raising an exception.
2. In upper index wrapping routine, only wrap lines that
have text

Finally, while testing, I found an independent bug (of mine)
which probably wouldn't occur in RL. I made a small index
by deleting most of the lines from the example supplied,
which left some page marks at the start of the closing
`I/` line. It then failed to recognize this as the end of the
index, and said "no match for opening `/I`". Fixed.
Copy link

@rtonsing rtonsing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works now. The /I explains why I didn't see an issue with the others I tried.

@windymilla windymilla merged commit 3d6ef48 into DistributedProofreaders:master Dec 21, 2024
1 check passed
@windymilla windymilla deleted the rewrap-exception branch December 21, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrap All error
3 participants