Skip to content

Commit d06c3a3

Browse files
committed
fix: preserve single quotes in blog post titles
The title extraction regex was removing everything from the first quote to end of line, cutting off titles containing apostrophes like "It's". Now only strips trailing quotes at the end of the line.
1 parent 2ac609e commit d06c3a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/detect-new-blog-post.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
fi
127127
128128
# Extract title from frontmatter
129-
TITLE=$(sed -n '/^---$/,/^---$/p' "$NEW_POST" | grep -E '^title:' | sed "s/^title:[[:space:]]*['\"]*//" | sed "s/['\"].*$//")
129+
TITLE=$(sed -n '/^---$/,/^---$/p' "$NEW_POST" | grep -E '^title:' | sed "s/^title:[[:space:]]*['\"]*//" | sed "s/['\"][[:space:]]*$//")
130130
131131
if [ -z "$TITLE" ]; then
132132
echo "Could not extract title"

0 commit comments

Comments
 (0)