[blog-renderer-table-fence-fix] fix broken markdown tables/fences, add tracked template downloads - #124
Conversation
…te downloads
The hand-rolled markdown renderer (app/lib/blog.ts) had no support for
```-fenced code blocks or `| a | b |` tables — either one silently
mangled into unreadable run-on prose (whitespace collapsed, literal
```/| characters left in the text). Confirmed LIVE-BROKEN on
namuthaj-mahdar-ijtimaa-ar (the site's only non-brand-click-earning
post) — its template section shipped as garbled text. Verified fixed
via a real `next build`: the same post now statically renders a proper
<pre><code> block, byte-for-byte the same source content.
Also adds the capability for posts to ship a real downloadable asset
(e.g. a copy-paste template as .docx) instead of relying on an inline
code fence: `template_download_href`/`template_download_label`
frontmatter -> new TemplateDownload component, tracked via
posthog.capture('template_download', ...) + gtag on click. First
consumer is the how-to-do-meeting-minutes draft (PR #113).
Verified: tsc --noEmit clean, `next build` succeeds (blog/[slug]
statically regenerates namuthaj-mahdar-ijtimaa-ar correctly).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bug found + fixed
app/lib/blog.ts's hand-rolled markdown renderer had zero support for GFM tables (| a | b |) or fenced code blocks (```). Either one silently collapsed into a single run-on paragraph with literal|/```characters left in the text.Confirmed live-broken on
namuthaj-mahdar-ijtimaa-ar— the site's only post earning non-brand organic clicks. Its copy-paste template section shipped as garbled text (verified against the live page before this PR).Fixed both:
<pre><code>(verbatim, not reflowed)<table>Verified via a real
next build: the same post's static page now regenerates the template section as a proper<pre>block, byte-identical source content, no stray markers.tsc --noEmitclean.New capability: tracked template downloads
Per Hassan: any "copy-paste template" a post promises should ship as a real downloadable file, not inline prose, and downloads should be tracked.
template_download_href/template_download_labelfrontmatter ->BlogPostMeta.templateDownloadTemplateDownloadcomponent (app/components/blog/template-download.tsx), rendered after the article -- tracksposthog.capture('template_download', {slug, href, format})+gtagon clickscripts/gen-template-docx.py-- reusable generator (python-docx) that turns a plain-text template into a real.docx, for future template-download postsFirst consumer: PR #113 (how-to-do-meeting-minutes), which now ships
app/public/downloads/meeting-minutes-template.docxinstead of an inline fence.Notes
gen-image.py->gemini-3.1-flash-image-preview) -- no code change needed there, locked in as a standing rule in the blogger routine's STEERING.md instead.🤖 Generated with Claude Code