diff options
Diffstat (limited to 'app/src/main/java/org/terst/feedreader')
| -rw-r--r-- | app/src/main/java/org/terst/feedreader/ui/ImageZoomLinks.kt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/org/terst/feedreader/ui/ImageZoomLinks.kt b/app/src/main/java/org/terst/feedreader/ui/ImageZoomLinks.kt index d924c02..179955e 100644 --- a/app/src/main/java/org/terst/feedreader/ui/ImageZoomLinks.kt +++ b/app/src/main/java/org/terst/feedreader/ui/ImageZoomLinks.kt @@ -36,8 +36,14 @@ private val imageFileExtensions = listOf(".jpg", ".jpeg", ".png", ".gif", ".webp * something already (ReaderExtractor's synthesized YouTube thumbnail is precisely this shape, * and wrapping it would swallow the tap that plays the video). Those are still zoomable when * the link points at an image file, which [zoomableImageTarget] handles on the other side. + * + * [baseUrl] is where the article itself lives, used to resolve an image address the feed wrote + * in shorthand. It has no default, deliberately: a caller that omits it does not silently get + * the behaviour that caused this bug -- every image on a site-relative feed like Ftrain's + * un-zoomable -- it fails to compile. Null is still a legitimate answer when there genuinely is + * no article address, but it has to be given on purpose rather than by forgetting. */ -fun linkifyImagesForZoom(html: String, baseUrl: String? = null): String = buildString { +fun linkifyImagesForZoom(html: String, baseUrl: String?): String = buildString { var copiedUpTo = 0 var anchorDepth = 0 for (tag in anchorOrImageTagRegex.findAll(html)) { |
