summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-08 00:01:18 +0300
committerPaul Buetow <paul@buetow.org>2025-07-08 00:01:18 +0300
commitec77007c1b89ba054cc7460968c2d7d7b0e20f01 (patch)
tree394c13e9680e1c5cb74c5a73046438b6cc13f2ed
parent89603744a9969622888dfc53fe6cb3936d801c34 (diff)
fix: handle markdown image titles in showcase image extraction
- Strip text after spaces/quotes in image URLs (e.g. 'image.png "Title"') - Fixes extraction of images from READMEs that use markdown title syntax 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
-rw-r--r--internal/showcase/images.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/showcase/images.go b/internal/showcase/images.go
index fe5be72..0fa37f7 100644
--- a/internal/showcase/images.go
+++ b/internal/showcase/images.go
@@ -148,6 +148,13 @@ func extractImageReferences(content string) []string {
// Clean and validate URL
url = strings.TrimSpace(url)
+
+ // Handle markdown image titles - remove anything after a space or quote
+ if idx := strings.IndexAny(url, " \"'"); idx != -1 {
+ url = url[:idx]
+ }
+ url = strings.TrimSpace(url)
+
fmt.Printf("DEBUG: Found potential image URL: %s\n", url)
if isImageFile(url) {