fix(tailwind-from-scratch): escape note attribute quotes correctly - #9
Merged
Merged
Conversation
Two lessons' <CodeDiff note="..."> attributes embedded a literal `\"..."` inside a plain JSX string attribute. JSX plain-attribute strings don't support backslash-escaping — the backslash is literal and the following quote closes the attribute early, desyncing the rest of the tag. Velite drops both lessons from the catalog as a result (silent 404 at runtime). Swap the inner double quotes for single quotes; no escaping needed. Verified both lessons now compile via @mdx-js/mdx (matches the Velite/apps-web toolchain).
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Adds a validate-mdx CI job that compiles every lesson MDX body via @mdx-js/mdx (with remark-directive, matching apps/web's Velite config) and fails the build on any parse error. Nothing in this pipeline previously checked MDX syntax at all — the publish-time checks (frontmatter, heading lint, sidecar YAML) never parse the MDX body as JSX, and Velite (apps/web) only runs downstream, disconnected from publish, where a bad lesson is silently dropped from the catalog (404 at runtime) rather than failing anything. This is defense-in-depth alongside the equivalent validate-mdx gate now added to pipeline-app's publish flow (skola-claude-plugins) — that gate catches it before the content even reaches this repo; this one catches it for any direct push that bypasses that pipeline.
…e fix Required by this repo's own changelog-guard gate (courses/*/** changes must be recorded in that course's CHANGELOG.md).
CI pins Node 20 (matching the rest of content-ci.yml), and fs.promises.glob doesn't exist until Node 22 — the validate-mdx job failed outright with a SyntaxError before it ever compiled a single file. Replaced with a portable manual recursive directory walk. Verified locally: still flags exactly the 2 known-bad lessons when pointed at their pre-fix content, and reports clean against this branch's fixed content.
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.
Summary
22-modu-sukuruand23-tailwind-cli-v4(kea.mdx) embed a literal<style type="...">/@import "..."snippet inside a<CodeDiff note="...">attribute, using backslash-escaped double quotes (\").attr="...") don't support backslash-escaping — the\is literal and the following"ends the attribute early, desyncing the rest of the tag. Velite (apps/web's MDX build) fails to compile both lessons and drops them from the catalog, which 404s those lesson routes at runtime.web:buildfor the first time since this course's publish (027512b5).deznode/skola-research(drafts are the source of truth for republish) — see that repo'scontent/topic-tailwind-from-scratchbranch, commit426c26d6.Fix
noteattributes — no escaping needed, meaning unchanged.validate-mdxCI job (+scripts/check-mdx-syntax.mjs) that compiles every lesson MDX body via@mdx-js/mdx(withremark-directive, matchingapps/web's Velite config) and fails on any parse error — nothing in this pipeline previously checked MDX/JSX syntax at all. Companion gate also added topipeline-app's publish flow (skola-claude-plugins) so this is caught before content even reaches this repo; this CI job is defense-in-depth for any direct push that bypasses that pipeline.Test plan
@mdx-js/mdx(matches the Velite/apps-web toolchain) — confirmed broken snippets reproduce the exact CI errors, and the fixed versions compile cleanattr="...\"...") — confirmed these are the only 2 occurrencescheck-mdx-syntax.mjsagainst the whole repo pre-fix (flags exactly these 2 lessons, no false positives from:::callout{}directive blocks) and post-fix (0 failures)web-build-testshould go green once this merges and a web-affecting PR rebuilds the catalog