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

roffit: Decrease the indent level for .PP #48

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

jay
Copy link
Collaborator

@jay jay commented May 29, 2024

Prior to this change when .PP (regular paragraph) was used after .IP (indented paragraph) roffit would not change the indent level which resulted in regular paragraphs having the same indent as the previously indented paragraph.

Ref: curl/curl#13803 (comment)

Closes #xxxxx


website2

I can't figure out if we should reset it like $indentlevel = 0 or just decrease it but in testing just decreasing seems to work as expected.

Prior to this change when .PP (regular paragraph) was used after
.IP (indented paragraph) roffit would not change the indent level which
resulted in regular paragraphs having the same indent as the previously
indented paragraph.

Ref: curl/curl#13803 (comment)

Closes #xxxxx
@jay
Copy link
Collaborator Author

jay commented May 29, 2024

according to groff manpage for .PP the "left margin and indentation are reset to default values" so I'm thinking the level should be reset to 0

@bagder
Copy link
Owner

bagder commented May 30, 2024

Not sure the distinction will make a big difference because these instructions never increase indent level much.

But I noticed in experimenting with this that .RE / .RS actually has a separate indentation level that .PP actually does not reset. We can deal with that later if we run into issues with it.

An nroff sequence like this:

.IP p.roffit
Used for the advertising final paragraph.
.RS
moo

.PP
Hello

Causes this output:

       p.roffit
              Used for the advertising final paragraph.
              moo

              Hello

The input without the .RS:

.IP p.roffit
Used for the advertising final paragraph.

moo

.PP
Hello

... then makes .PP go back correctly;

       p.roffit
              Used for the advertising final paragraph.

              moo

       Hello

@bagder bagder merged commit 420fda2 into bagder:master Jun 4, 2024
2 checks passed
@jay jay deleted the fix_pp_indent branch June 4, 2024 17:08
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.

2 participants