Register the shipped TableConverter so <table> renders as a markdown table (fixes #38) - #41
Open
namaserajesh wants to merge 1 commit into
Open
Conversation
… markdown table GFM tables are an opt-in extension in league/html-to-markdown, so createDefaultEnvironment() registers every converter the library ships EXCEPT TableConverter. Without it, <table> falls through to DefaultConverter, which concatenates cell text with no separators — a 4x3 pricing table arrives as 'PlanPriceStorageSupportFree$05 GBCommunity...' and no consumer can recover the grid. Tables are among the densest content an LLM can ingest, so this is the opposite of the plugin's purpose. The library has shipped TableConverter since 5.0.0 (2021) and already carries table_pipe_escape / table_caption_side defaults for it — only the registration is missing. One line plus the import. Fixes ProgressPlanner#38.
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.
Follow-up to my comment on #38 — here is the offered fix as a concrete diff.
The bug
Any post containing an HTML
<table>loses all tabular structure in the.mdoutput:league/html-to-markdown'screateDefaultEnvironment()registers every converter the library ships exceptTableConverter(GFM tables are an opt-in extension), so<table>falls through toDefaultConverter, which concatenates cell text with no separators. A 4×3 pricing table arrives asPlanPriceStorageSupportFree$05 GBCommunity…— unrecoverable for the LLM/agent consumers this plugin exists to serve, and tables are among the densest content those consumers can ingest.Note the root cause is registration, not a missing dependency: the library has shipped
TableConvertersince 5.0.0 (2021) and already carries thetable_pipe_escape/table_caption_sideoption defaults for it. The fix is one line plus the import.Verification
We have run exactly this change in production on two WordPress sites since 2026-07-20:
.mdalternates (headers, row boundaries, and cell separation all preserved).Happy to adjust style/placement to your conventions.