Skip to content

Fix inline code wrapping idempotence - #282

Open
somiljain2006 wants to merge 3 commits into
swiftlang:mainfrom
somiljain2006:Inline-code-wrapping
Open

Fix inline code wrapping idempotence#282
somiljain2006 wants to merge 3 commits into
swiftlang:mainfrom
somiljain2006:Inline-code-wrapping

Conversation

@somiljain2006

Copy link
Copy Markdown
Contributor

Bug/issue #, if applicable: Fixes #197

Summary

Fix inline code wrapping idempotence and trailing whitespace handling

Prevent extra newlines and trailing spaces when wrapping inline code by trimming trailing whitespace before queued line breaks and preserving formatter state during speculative inline code layout. This restores idempotency across repeated formatting passes.

Dependencies

N/A

Testing

Adds regression tests that cover inline code wrapping in paragraphs, lists, ordered lists, blockquotes, and existing soft-break scenarios

Steps:
Run MarkupFormatterTests

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded

@somiljain2006

Copy link
Copy Markdown
Contributor Author

@d-ronnqvist Can you review this pr?

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.

MarkupFormatter is inserting extra newlines

1 participant