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 some roff output issues #102

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

npmccallum
Copy link

  1. Replace three consecutive dots with the ellipsis character.
  2. Fix control character handling.

Lots of effort goes into escaping the periods. Instead, let's just
replace the three consecutive periods with an ellipsis character. This
decreases the size of the output and doesn't get interpreted as a
control character.
The current attempt at escaping control characters had a number of
problems.

First, it would replace a single-quote character with a backtick. This
means that if you used single-quote characters in a code example, it
would be replaced with an incompatible character.  This resulted in
code examples that couldn't be copy-pasted.

Second, it replaced all characters that could be control characters,
regardless if they were in control position or not. Only the first
character on the line is potentially a control character. The previous
code, however, replaced all possible control characters, leading to
bloating in output.

Third, the documented way to escape control characters was not
followed. We should escape them by inserting a zero-width character in
the control character position (first character on the line). This was
partially done, but only for periods and not other control characters.

This patch should correct these issues so that control characters are
properly escaped in all instances.
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.

1 participant