Repository navigation
Conversation
A quote, heading or code block that ends a list item left its bottom margin spacer before the next item, which showed as a blank gap (a double one after a quote). Remove that trailing spacer so the next item, or the list's own margin, follows directly. The block's own line ends stay, so a code block keeps its bottom padding and corners. React Native keeps this margin.
There was a problem hiding this comment.
🟡 Changes recommended
Quotes ending in code blocks retain an inner margin spacer, and the new test does not detect the remaining gap.
1 open issue
What changed in this PR
This Android-only change builds on #1065 by removing trailing block margins from list items while preserving code-block padding and corners.
Changes:
- Trim a trailing margin spacer before finalizing each list item.
- Add regression coverage for items ending in code blocks and quotes.
| File | Description |
|---|---|
packages/enriched-markdown-android/ui/src/test/java/com/swmansion/enriched/markdown/ListChildrenRenderingTest.kt |
Adds checks for spacing before the next list item. |
packages/enriched-markdown-android/ui/src/main/java/com/swmansion/enriched/markdown/renderer/ListItemRenderer.kt |
Removes the final block-margin spacer from list items. |
Review effort: Balanced
Comment on lines
+174
to
+175
| spacers.forEach(builder::removeSpan) | ||
| builder.delete(spacerStart, builder.length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What/Why?
Stacked on #1065. A quote, heading or code block that ends a list item left its bottom margin spacer before the next item, which showed as a blank gap (a double one after a quote). The trailing spacer is now removed, so the next item, or the list's own margin, follows directly, as it does after a paragraph. The block's own line ends stay, so a code block keeps its bottom padding and corners.
React Native keeps this margin; Android drops it on purpose.
Testing
PR Checklist