From 89dc118ecd29ad2f2e6ea29d8e1e0de502ed0201 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 2 Jan 2026 22:47:58 -0800 Subject: [PATCH] fix: add workflow step to escape nested quotes in post titles --- .gitea/workflows/publish.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml index 2a37b5f..176842e 100644 --- a/.gitea/workflows/publish.yaml +++ b/.gitea/workflows/publish.yaml @@ -23,6 +23,14 @@ jobs: submodules: true # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + - name: Fix nested quotes in post titles + run: | + # Find markdown files with titles containing at least 3 double quotes (indicating nesting) + # and replace internal double quotes with single quotes. + find content -type f -name "*.md" -print0 | \ + xargs -0 grep -lZ '^title: .*".*".*"' | \ + xargs -0 -r sed -i "/^title: \"/{s/\"/\\\\\"/g;s/^\(title: *\)\\\\\"/\1\"/;s/\\\\\" *$/\"/;}" + - name: Build site with Hugo uses: peaceiris/actions-hugo@v3 with: