Fix 'ltr'/'rtl' text appearing visibly in item content#45
Merged
Conversation
The dir value was rendered as a text node inside a <div class="dir"> instead of being set as an HTML attribute. Move dir onto the .desc div where it belongs for correct RTL/LTR text-direction control. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes an item-list UI issue where the text direction value (ltr/rtl) was being rendered as visible content by moving direction handling to a semantic dir attribute on the description container.
Changes:
- Removed the dedicated
.direlement that displayedltr/rtlas text. - Applied
dir=${dir}directly to the existing.descelement.
| </div> | ||
| <div class="dir">${dir}</div> | ||
| <div class="desc" dangerouslySetInnerHTML=${{ __html: item.desc || '' }}></div> | ||
| <div class="desc" dir=${dir} dangerouslySetInnerHTML=${{ __html: item.desc || '' }}></div> |
- Guard against nil PublishedParsed/UpdatedParsed to prevent nil deref panic on feeds like BBC Persian that omit <pubDate> - Fall back from Content to Description for Desc, so feeds that only use <description> (not <content:encoded>) show their body text - Compute Dir as "rtl"/"ltr" via unicode range detection instead of storing the raw description text (which was a copy-paste bug) - Fix silent test assertions (ObjectsAreEqualValues was discarded) and correct the stale expected values they were hiding Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ble text Verifies that the .desc div carries a dir attribute (ltr/rtl) and that no standalone direction token appears as text content in an item row. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
Added a Playwright test in |
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.
Summary
ItemRow.jshad a<div class="dir">${dir}</div>that rendered the text-direction value (ltrorrtl) as visible text in every itemdir=${dir}as an attribute on the existing.descdiv, which is the correct semantic placementTest plan
🤖 Generated with Claude Code