{
  "id": 4730594,
  "title": "Blog Pipeline Fence Corruption: How a Naive Sed Rule Swallowed Markdown Code Blocks",
  "url": "https://urgent.news/2026/08/31/blog-pipeline-fence-corruption-how-a-naive-sed-rule-swallowed",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-31T22:15:48.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/futhgar/blog-pipeline-fence-corruption-how-a-naive-sed-rule-swallowed-markdown-code-blocks-43p4"
  },
  "original_language": "en",
  "account": "According to the source, a blog generation pipeline contained a rule that caused corruption of Markdown code blocks. The rule was implemented using sed to remove a specific pattern from the generated Markdown. However, it replaced every bare closing fence in the document, deleting all code block endings and leaving all code blocks unclosed. This resulted in Astro, the rendering engine, interpreting the rest of the file as code, leading to unexpected behavior. The problem was discovered when the pipeline was moved from a local model to a cloud backend, as local models did not trigger the issue. The source explains that the sed rule was written for a problem that mainly existed on one branch of the pipeline and damaged output on both branches. The fix involved changing the rule to match the signature of a whole-document wrapper instead of using substitution, which matched on a pattern and acted only on specific lines.",
  "summary": "A draft came out of my blog generation pipeline with the frontmatter intact, the title correct, the word count in range, and roughly 1,400 words of prose rendered inside a single syntax-highlighted code block. Everything after the first bash example was gray monospace on a dark background. The build passed. The exit code was 0. One sed expression caused it, and it had been sitting in the…",
  "key_points": [
    "Sed rule corrupted Markdown code blocks by removing closing fences, causing unclosed code blocks.",
    "Fix involved changing sed rule to match whole-document wrapper instead of substitution."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}