Repository navigation
Tableaux : exiger une ligne séparatrice et gérer les pipes échappés - #45
Merged
Merged
Conversation
Any line with two pipe-separated cells used to become a table, so prose
like "cats | dogs | birds" rendered as a header-only <table>.
Tables now follow GFM §4.10:
- a header row is a table only when the next line is a delimiter row
with the same number of cells; body rows continue until a blank line
or the start of another block
- single-column tables ("| a |" / "| - |") are supported
- cells split on unescaped pipes only; \| becomes a literal pipe before
inline parsing, including inside code spans
- rows are padded or truncated to the header's cell count
Row splitting and delimiter parsing live in Lexer\TableCells, shared by
Lexer (detection) and Parser (cells, alignment).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CPcuaaxrCottkeL1ykoSWe
jmcollin
pushed a commit
that referenced
this pull request
Oct 8, 2026
Conflicts in src/Lexer/Lexer.php with the blockquote laziness change (#44) and table detection (#45), all side-by-side additions: - quote pattern from main, list patterns from this branch - both state blocks (quote laziness, open list columns) - quote lazy continuation first, then list item continuation - list item placement before table detection (it may turn an item into a paragraph line) Also drops the PATTERN_TABLE_SEPARATOR reference left by #44 (same change as #50), without which every blockquote throws on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CPcuaaxrCottkeL1ykoSWe
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.
Problème
|devenait un tableau.I like cats | dogs | birdsproduisait un<table>avec seulement un en-tête.\|coupait quand même la cellule (explode('|')).Correctif (GFM §4.10)
:?-+:?par cellule) avec le même nombre de cellules. Les lignes du corps continuent jusqu'à une ligne vide ou au début d'un autre bloc.| a |/| :-: |) sont supportés.|non échappés.\|devient un|littéral avant le parsing inline, y compris dans un code span.Lexer\TableCells, partagé par le Lexer (détection) et le Parser (cellules, alignements).PATTERN_TABLE_ROWetPATTERN_TABLE_SEPARATORsont supprimés.Précision par rapport à la review : selon GFM, un
|non échappé dans un code span sépare quand même les cellules. Pour l'inclure dans une cellule, il faut écrire`x\|y`, ce qui est maintenant géré.Tests
tests/Integration/TableTest.php(7 cas), plus deux tests négatifs dansLexerTest.TABLE_ROWpour une ligne seule (sans ligne séparatrice) ont été adaptés : c'était le bug.|||hors bloc colonnes est maintenant un paragraphe.🤖 Generated with Claude Code
https://claude.ai/code/session_01CPcuaaxrCottkeL1ykoSWe
Generated by Claude Code