Urgent.News

What's breaking now, across thousands of outlets.

Tech

My HTML-to-Markdown converter shipped tables my spreadsheet API couldn't parse — the colspan lie

Built the HTML-to-Markdown endpoint so agent pipelines could turn messy web pages into clean Markdown. Tables looked perfect in my tests: pipe tables, aligned columns, the works. Then I pointed my XLSX converter at the output and watched it silently produce garbage — every row after a colspan was shifted one column left, and no error anywhere. Turned out the Markdown table spec has no way to…

I developed an HTML-to-Markdown converter to enable agent pipelines to transform complicated web pages into clean Markdown. Initially, tables appeared flawless during testing, displaying pipe tables and aligned columns. However, I encountered an issue when feeding the converted output to my XLSX converter; it produced garbage data, with every row after a colspan shifted one column to the left, without triggering any error messages.

Upon investigation, I discovered that the Markdown table specification lacked a way to represent a cell spanning two columns. My converter inadvertently emitted cell text in one cell, then the next cell's text in the subsequent cell, leading downstream components to shift their columns. This discrepancy meant that while a human reading the rendered table could comprehend the alignment, a parser consuming the pipe syntax would interpret the table as having the incorrect number of columns per row.

The solution didn't lie within the Markdown format itself. Instead, I introduced a table_mode option to the HTML converter, offering two modes: markdown (the default, human-readable) and grid (which expands colspan and rowspan into repeated cells, ensuring every row maintains an identical column count). Although the grid mode produces output that appears duplicated and less aesthetically pleasing, it is the sole version capable of being reliably parsed back into structured data by agents.

This experience reaffirmed a critical lesson for me: a format that looks correct to a human eye does not necessarily align with a format that a machine can accurately reverse-engineer. Markdown tables, while visually appealing, operate as display formats masquerading as data formats. When constructing pipelines that convert HTML → Markdown → table data, it is essential to rigorously test the round trip rather than solely focusing on rendering.

To accommodate both modes, I packaged the converter at https://x402.freeq.one/tools/html_to_markdown.html, where specifying table_mode=grid directs the output to feed a parser rather than a prompt.

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

Refactoring a Distributed Cache for Strong Reads When Eventual Consistency Fails

we hit a subtle bug in our order‑service after a recent traffic surge: occasional duplicate invoices appeared in the admin UI. the root cause?

  • Team refactored cache to write-through model for strong reads
  • Switched from eventual consistency to immediate DB-Redis update
  • Implemented write-through helper with transaction-like pattern

Flutter Repository Pattern: Keep API Calls Out of Widgets

Open any Flutter project that has been alive for more than six months and you will find it: a widget with an http.get buried in initState , a Firestore query inside a build method, a SharedPreferences…

  • Widgets no longer call HTTP, Firestore, or SharedPreferences directly
  • Repository pattern encapsulates data access behind a clear interface
  • Product class and ProductsRepository enable maintainable, testable code

SonicWall SMA1000: Chaining CVE-2026-83548 and CVE-2026-83549

SonicWall SMA1000: Chaining CVE-2026-83548 and CVE-2026-83549 Why an SSL VPN gateway is a high-value target A remote access gateway sits between the internet and the internal network and holds the…

  • SonicWall releases patches for CVE-2026-83548 and CVE-2026-83549 on September 1, 2026
  • Exploiting both vulnerabilities together grants unauthenticated attacker command execution
  • Organizations advised to apply patches and monitor for suspicious activity

Meet fm: file manager for terminal

O que é O fm é um gerenciador de arquivos para terminal focado na operação via teclado. Ele integra ferramentas como fzf para navegação rápida com filtragem instantânea e eza para exibição de ícones e…

  • fm is a terminal file manager for keyboard navigation.
  • Built with fzf, eza, ripgrep, and trash-cli for efficiency.
  • Supports Linux, macOS, BSD, and requires Kitty for preview/gallery.

More from Thursday 15 October →