‹ Back to My Devblog
Debugging Backend

A reader reported that /docs/roblox-production-ad-placements-1speed showed a page of JavaScript instead of an article. When I went looking, ten other pages did the same.

What was actually on those pages

The documentation is imported from Roblox's Creator Hub, and a few of those pages aren't plain Markdown. They are small React programs: a {(() => { ... })()} block that defines its own components and keeps its data in arrays. My importer threw away capitalised tags, which is where the content lived, and printed everything left over as code.

Reading the code without running it

The tempting fix is to run the block and capture the output. I didn't want to execute imported code, so scripts/lib/inline-components.mjs parses the block and walks it with a small interpreter instead. There are no globals and no prototypes, only the page's own functions, and it runs under a step and depth limit. If a block uses anything outside that subset, the importer leaves it out and prints a warning at import time. Printing raw code is no longer an outcome.

What came out

The interpreter writes what the block would have drawn as Markdown: a title, a screenshot linked to its game, the labelled details. On the ad placements index, every game gets a card under its heading. On the guides page, each genre gets its PDF.

Finding the rest

I scanned all 4,484 pages for code in their text. That turned up 11 pages with the React blocks (nine ad placement pages, the index and the rewarded video guides) and twelve with stray <> fragments left behind by removed layout components.

Looking for those also exposed links that went nowhere, in three shapes the link rewriting didn't read: a picture inside a link, an address broken across two lines in the source, and link text that wraps onto a second line. After the fix I checked every link in every page, 69,170 of them, and none were unresolved. Re-running the importer changed only 30 pages and the manifest.

Tests cover the converter, its limits and the link shapes, with sweeps that fail if any imported page has code left over or a dead link.