~nytpu/public-inbox

Trim newlines and CRs in get_post_title v1 APPLIED

FIGBERT: 1
 Trim newlines and CRs in get_post_title

 1 files changed, 2 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~nytpu/public-inbox/patches/29358/mbox | git am -3
Learn more about email & git

[PATCH] Trim newlines and CRs in get_post_title Export this patch

---
 gemlog.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gemlog.sh b/gemlog.sh
index 1c83b0e..c3a497c 100755
--- a/gemlog.sh
+++ b/gemlog.sh
@@ -47,7 +47,7 @@ make_globals() {
}

get_post_title() {
	cat "$1" | perl -lne 's/#{1,3}\s*(.*)/\1/ or next; print; exit'
	cat "$1" | perl -lne 's/#{1,3}\s*(.*)/\1/ or next; print; exit' | tr -d '\r\n'
}

make_atom() {
@@ -81,7 +81,7 @@ EOF
		| while IFS='' read -r i; do
			expr "$n" '>=' "$number_of_feed_articles" > /dev/null && break
			printf "\n  <entry>\n    <title>"
			get_post_title "$i" | tr -d '\n'
			get_post_title "$i"
			printf "</title>\n    <id>$global_url${i#'./'}</id>\n"
			printf "    <link rel='alternate' href='$global_url${i#'./'}'/>\n    <updated>"
			echo "$i" | perl -ne '/^(\d{4}-\d{2}-\d{2}).*/; print "$1T12:00:00"' | tr -d '\n' | sed "s/\$/$tz/"
-- 
2.35.1
Thanks!

~nytpu