fix: run publish on PRs and unblock 2026-02-13#31
Merged
Gavin-WangSC merged 2 commits intoComputerization:mainfrom Apr 29, 2026
Merged
Conversation
Verified end-to-end locally with full md2tex + lualatex run.
1) Run the publish workflow on PRs as a check (auto-publisher.yml)
- Add pull_request trigger gated to relevant paths.
- Skip Fetch Article (git pull origin main) on PRs so the test
reflects the PR head, not main.
- Skip Commit and Push Changes on PRs so feature branches never
push generated artifacts to main.
This is what surfaces the rest of these fixes as a check before
merge instead of after.
2) Skip monthly batch when a member post failed to compile
- batch() reads each post's index.tex; a skipped post has none.
- Now checks all members exist before assembling the batch and
bails gracefully if lualatex itself produces no PDF for a batch.
- Verified: batches 62 and 66 (containing 2026-03-17 and 2026-04-11
respectively, both still broken) skip cleanly; the surrounding
batches still compile.
3) Repair 2026-02-13 markdown
Two distinct md4c parse failures were producing the original
'textbackslash invalid in math mode' / 'Missing $ inserted' from
lualatex:
- Inline $h(n)$ adjacent to Chinese punctuation ($h(n)$,)
defeats md4c's flanking rules for LATEXMATH spans, so the
dollars and contents fall through to the plain-text escaper.
Pad a single ASCII space between $ and adjacent CJK chars.
- Bare 'A*' / 'D*' get paired across paragraphs as italic
emphasis, wrapping huge regions (math included) in textit{...}
where every backslash and dollar then gets escaped.
Backslash-escape the asterisks (A\*, D\*).
Local lualatex now compiles a 191 KB index.pdf with no errors.
✅ Deploy Preview for c13n-newsletter ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The previous regex over-applied: it escaped A* to A\* inside the description value of the YAML frontmatter, which js-yaml rejects as 'unknown escape sequence' and which broke the Astro site build (and the Netlify deploy preview). scripts/make.py's metaext strips frontmatter before md2tex runs, so the asterisk in description never reaches the markdown pipeline and doesn't need escaping. Body asterisks remain escaped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Verified end-to-end locally with the full
md2tex+lualatexpipeline before opening this PR.What's in here
1. Run the publish workflow on PRs as a check (
auto-publisher.yml)pull_request:trigger gated to the relevant paths (src/content/blog/**, scripts, LaTeX, workflow files).Fetch Article(git pull origin main) onpull_requestso the test reflects the PR head, not main.Commit and Push Changesonpull_requestso feature branches never push generated artifacts to main.This is the structural fix for the merge-and-pray workflow that produced #28, #29, and #30 each catching the next failure downstream. Future PRs that touch the publish path will validate in CI before merge.
2. Repair
2026-02-13markdownTwo distinct md4c parse failures combined to produce the original
\textbackslash invalid in math mode/Missing $ insertedfrom lualatex:$h(n)$adjacent to Chinese punctuation ($h(n)$,) defeats md4c's flanking rules forLATEXMATHspans, so the dollars and contents fall through to the plain-text escaper and emerge as\${}/\textbackslash{}. Fix: pad a single ASCII space between$and any adjacent CJK char or fullwidth punctuation.A*/D*(algorithm names) get paired across paragraphs as italic emphasis, wrapping huge regions (math included) in\textit{...}where every backslash and dollar then gets escaped. Fix: backslash-escape the asterisks (A\*,D\*).Local lualatex now compiles a 191 KB
index.pdfwith no errors.Local verification
python3 scripts/make.py postran clean over all 352 source posts.2026-02-13producedindex.pdf/index.tex. Two unrelated articles (2026-03-17,2026-04-11) have separately corrupted markdown that I haven't touched here — they're now correctly skipped by the resilience added in fix: keep publish job alive when one post's LaTeX fails #28/fix: create public/blog/<post>/ before copying tex+pdf #29 instead of crashing the job.python3 scripts/make.py batchran clean over batches 57–69. Batches 62 and 66 (containing the two still-broken posts) skipped cleanly via fix: skip monthly batch when a member post failed to compile #30's logic; the other 11 batches compiled.Test plan
Publish New Articlecheck (now triggered by the newpull_request:trigger) goes green.Generate New Articlerun produces and commitspublic/blog/2026-02-13/index.pdf, the daily new article PDF, and the relevant new monthly batches.