Urgent.News

What's breaking now, across thousands of outlets.

Tech

My HTML-to-Markdown output passed every test I wrote — then flattened in a strict parser

An agent piped a wiki export through my HTML-to-Markdown converter into a RAG pipeline and reported that hierarchy was disappearing. Every nested task list came out flat: sub-items rendered as siblings of their parents. Sections got chunked together that had nothing to do with each other, and retrieval started returning paragraphs attributed to the wrong topic. Here's the part that stung: the…

A developer discovered an issue with their HTML-to-Markdown converter after running a series of tests. The converter passed all the tests, but the output flattened nested list items into flat lists when fed into a strict parser. The problem stemmed from the converter indents nested list items using two spaces, which is accepted by lenient parsers and most browser previews but not by strict CommonMark parsers.

The developer's test suite only checked the output against one parser, a lenient one, and this proved insufficient. The fix was simple, but the diagnosis was difficult. To ensure compatibility with different parsers, the developer now runs a small harness in CI that converts HTML to Markdown, re-parses the result with three different Markdown implementations, and compares the resulting trees. If there is any disagreement, the build fails.

This experience highlighted that Markdown is not a single format but a family of dialects with varying interpretations of indentation, heading style, emphasis, and tables. The developer's converter, available at https://x402.freeq.one/tools/html_to_markdown.html, provides options for heading style, bullet marker, and code fence to accommodate the various parsers that might be encountered.

The takeaway is that when converting HTML to Markdown for use in RAG pipelines, it is crucial to test the round trip with the specific parser that will be used at the end of the pipeline, not just the one used for initial testing.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How I Built a Multi-Track Car Racing Game in Scratch

How I Built a Multi-Track Car Racing Game in Scratch Building a racing game in Scratch starts with a simple idea: make a car move around a track.

  • Multi-track car racing game in Scratch with three distinct tracks
  • Speed system adapts based on track colors, slows down in certain areas
  • Collision detection uses separate sprite, instantly stops car on collision

When the cluster looked idle but nothing would schedule

The first thing I checked was the obvious one: CPU. Our non-prod EKS workers are Karpenter-managed, and application pods had been sitting in Pending long enough that Istio and app syncs were backing…

  • Kubernetes cluster pending pods despite ample CPU resources
  • Karpenter logs: "Failed to schedule pod, all available instance types exceed limits for nodepool"
  • Team increased memory limit to 160Gi, removed hardcoded instance type requirement

I Built a QR-Code File Transfer App with Spring Boot and Vanilla JavaScript

What if you could send a file from one device to another with no cable, no Bluetooth and no cloud upload, using only a screen and a camera?

  • QR File Transfer app developed using Spring Boot and vanilla JavaScript
  • File broken into 400-byte chunks, encoded in base64 and QR codes
  • Receiver scans QR codes with camera, reconstructs and downloads file

More from Sunday 4 October →