summaryrefslogtreecommitdiff
path: root/lib/gemfeed.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-01 17:39:53 +0200
committerPaul Buetow <paul@buetow.org>2026-03-01 17:39:53 +0200
commit6136b8a79a7f0ce5e35dc07cd88965953bd0e1af (patch)
treea916024f725f8de6e79d85cabfaecfb723ac65b7 /lib/gemfeed.source.sh
parent309c63c420c425a55ee2a91dd03c77138305a05d (diff)
Extract generate::extract_title helper to eliminate duplication
Title extraction ($SED pattern + quote sanitization) was duplicated in generate, atomfeed, gemfeed, notes, and template modules. Now centralized with unit tests for heading extraction and empty files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'lib/gemfeed.source.sh')
-rw-r--r--lib/gemfeed.source.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/gemfeed.source.sh b/lib/gemfeed.source.sh
index 40792cc..8700ac4 100644
--- a/lib/gemfeed.source.sh
+++ b/lib/gemfeed.source.sh
@@ -47,8 +47,7 @@ GEMFEED
while read -r gmi_file; do
# Extract first heading as post title.
- local title=$($SED -n '/^# / { s/# //; p; q; }' \
- "$gemfeed_dir/$gmi_file" | tr '"' "'")
+ local title=$(generate::extract_title "$gemfeed_dir/$gmi_file")
# Extract the date from the file name, and also get the word count.
local filename_date=$(basename "$gemfeed_dir/$gmi_file" | cut -d- -f1,2,3)