diff options
Diffstat (limited to 'app/src/main/java/org/terst')
| -rw-r--r-- | app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt b/app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt index 1fd2411..e69dd9b 100644 --- a/app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt +++ b/app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt @@ -126,6 +126,13 @@ fun wrapReaderHtml(bodyContent: String, title: String? = null): String = """ a { color: #8ab4f8; } img { max-width: 100%; height: auto; } svg { max-width: 100%; } + /* WordPress captioned images (<figure class="wp-caption" style="width: 448px">, or the + older <div class="wp-caption" style="width: ...">) carry a fixed pixel width inline on + the wrapper itself, sized for the source site's wider column. Our img rule above only + clamps the <img>, which then just fills that oversized wrapper -- so the wrapper (and + the image with it) blows past the reader's own column edge on a narrow screen. Clamp + the wrapper too; max-width still wins over the inline width per the CSS box model. */ + figure, .wp-caption { max-width: 100%; box-sizing: border-box; } /* A decorative icon (section badge, share glyph, etc.) that slipped through extraction relies on the source site's own stylesheet for its real display size (commonly Tailwind classes like "h-5 w-5") -- which we don't load here. |
