-
Notifications
You must be signed in to change notification settings - Fork 221
Fixes some issues with line wrapping around inline code #215
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
base: main
Are you sure you want to change the base?
Conversation
- Inline code that would have wrapped at the beginning of a line no longer gets an extra blank line before it. - Punctuation immediately following inline code is no longer pushed to the next line. - A line break is inserted before a symbolic link that would overflow the preferred line length.
@swift-ci Please test |
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good but I found the test data a bit hard to reason about.
let source = """ | ||
Because options are parsed before arguments, an option that consumes or | ||
suppresses the `--` terminator can prevent a ``postTerminator`` argument | ||
array from capturing any input. In particular, the | ||
``SingleValueParsingStrategy/unconditional``, | ||
``ArrayParsingStrategy/unconditionalSingleValue``, and | ||
``ArrayParsingStrategy/remaining`` parsing strategies can all consume | ||
the terminator as part of their values. | ||
""" | ||
let expected = """ | ||
Because options are parsed before arguments, an option that consumes or | ||
suppresses the `--` terminator can prevent a ``postTerminator`` argument | ||
array from capturing any input. In particular, the | ||
``SingleValueParsingStrategy/unconditional``, | ||
``ArrayParsingStrategy/unconditionalSingleValue``, and | ||
``ArrayParsingStrategy/remaining`` parsing strategies can all consume the | ||
terminator as part of their values. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: This example data confused me for a bit because the input was already wrapped almost the same as the expected output (only one word wrapped differently). Because of this, I found it difficult to reason about how this test would have behaved differently without the changes in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! That wrapping change wasn't intended – I'll fix that and change the example data to describe the behavior it's validating. (I wasn't quite sure how to go here since these are fixes for bugs that aren't exposed in the current tests.)
let source = """ | ||
Perform an atomic logical AND operation on the value referenced by | ||
`pointer` and return the original value, applying the specified memory | ||
ordering. | ||
""" | ||
let expected = """ | ||
Perform an atomic logical AND operation on the value referenced by | ||
`pointer` and return the original value, applying the specified memory | ||
ordering. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: The input and expected output are identical. Because of this, I find it harder to reason about how this test would have behaved differently without the changes in this PR.
Summary
Dependencies
n/a
Testing
Unit tests include new test cases that validate this functionality.
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded