Skip to content

Tables: Implement nested tables (!===) #277

@nlopes

Description

@nlopes

Problem

Nested table syntax using !=== separators is not supported.

AsciiDoc syntax

[cols="1,2"]
|===
| Outer Cell 1
a|
[cols="1,1"]
!===
! Inner A ! Inner B
! Inner C ! Inner D
!===

| Outer Cell 2
| Simple content
|===

The !=== delimiter and ! cell separator allow tables inside AsciiDoc cells (a|).

Current behavior

The !=== syntax is not recognized. Inner table content is treated as literal text.

Implementation requirements

1. Parser changes

  • Recognize !=== as nested table delimiter in parse_rows_with_positions()
  • Track nesting depth to handle ! vs | cell separators correctly
  • Recursive parsing for table-in-cell content

2. AST considerations

The current model already allows Vec<Block> in table cells, so nested Table blocks should work once parsing is fixed.

3. HTML renderer

Should already handle nested tables since it walks block content recursively. May need testing.

Workaround

  • Flatten table structure
  • Use description lists for hierarchical data
  • Use multiple separate tables

Priority

Low - rare use case in practice.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions