Skip to content

Commit fee8f39

Browse files
nlopesclaude
andcommitted
fix(parser): stop dlist from consuming block attributes as principal text
Adds a negative lookahead for `attributes_line()` in the `principal_content` continuation loop so that block attributes (e.g. `[cols="..."]`) immediately after a definition list term are no longer swallowed as continuation text. Closes #332 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c1e9f7a commit fee8f39

File tree

6 files changed

+1456
-0
lines changed

6 files changed

+1456
-0
lines changed

acdc-parser/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
### Fixed
1919

20+
- **Tables after definition list items now parse correctly** — when a definition list
21+
term with an empty description was immediately followed by block attributes (e.g.,
22+
`[cols="..."]`) and a table delimiter, the attributes line was consumed as principal
23+
text of the dlist item. The `principal_content` continuation loop now has a negative
24+
lookahead for `attributes_line()`. ([#332])
2025
- **Bare autolinks no longer capture trailing punctuation** — URLs like
2126
`https://example.com.` now correctly exclude the trailing `.` from the link target.
2227
A new `bare_url()` rule with balanced parenthesis handling ensures sentence-level
@@ -282,6 +287,7 @@ Initial release of acdc-parser, a PEG-based AsciiDoc parser with source location
282287
[#321]: https://github.com/nlopes/acdc/issues/321
283288
[#323]: https://github.com/nlopes/acdc/issues/323
284289
[#327]: https://github.com/nlopes/acdc/issues/327
290+
[#332]: https://github.com/nlopes/acdc/issues/332
285291
[#335]: https://github.com/nlopes/acdc/issues/335
286292

287293
[0.4.0]: https://github.com/nlopes/acdc/releases/tag/acdc-parser-v0.4.0
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[cols="35%,35%,30%",options="header"]
2+
|===
3+
|col 1|col 2|col 3
4+
|row1c1|row1c2|row1c3
5+
|row2c1|row2c2|row2c3
6+
|===
7+
8+
9+
10+
Table Nested in Definition List:::
11+
[cols="35%,35%,30%",options="header"]
12+
|===
13+
|col 1|col 2|col 3
14+
|row1c1|row1c2|row1c3
15+
|row2c1|row2c2|row2c3
16+
|===

0 commit comments

Comments
 (0)