Skip to content

FIX: Add table tag passthrough support and fix quote trailing newlines#4

Open
RubenOussoren wants to merge 5 commits intomainfrom
dev/table-tag-support
Open

FIX: Add table tag passthrough support and fix quote trailing newlines#4
RubenOussoren wants to merge 5 commits intomainfrom
dev/table-tag-support

Conversation

@RubenOussoren
Copy link
Copy Markdown
Contributor

  • Add AST classes Table, TableRow, TableCell (passthrough: strip wrapper tags, preserve cell content for Discourse which has no table syntax)
  • Register table/tr/td/th handlers in BBCode handler registry
  • Register passthrough renderer tags in Discourse TagLibrary
  • Append \n\n after named [quote] blocks to ensure paragraph separation
  • Add unit specs for Table/TableRow/TableCell AST classes
  • Add TagLibrary registration tests for all three table classes
  • Pin table system tests to exact eq outputs; add empty/whitespace-cell edge cases

@RubenOussoren RubenOussoren requested a review from gschlager March 10, 2026 19:43
@RubenOussoren RubenOussoren self-assigned this Mar 10, 2026
@RubenOussoren RubenOussoren force-pushed the dev/table-tag-support branch from 52e9b52 to 001c5c2 Compare March 10, 2026 19:47
@gschlager gschlager force-pushed the main branch 11 times, most recently from c8531b1 to e9c9544 Compare March 20, 2026 17:06
- Add AST classes Table, TableRow, TableCell (passthrough: strip wrapper
  tags, preserve cell content for Discourse which has no table syntax)
- Register table/tr/td/th handlers in BBCode handler registry
- Register passthrough renderer tags in Discourse TagLibrary
- Append \n\n after named [quote] blocks to ensure paragraph separation
- Add unit specs for Table/TableRow/TableCell AST classes
- Add TagLibrary registration tests for all three table classes
- Pin table system tests to exact eq outputs; add empty/whitespace-cell
  edge cases

Made-with: Cursor
@gschlager gschlager force-pushed the dev/table-tag-support branch from 001c5c2 to 66379b3 Compare March 20, 2026 19:20
Parse [IMG2=JSON]{'src':'...'}[/IMG2] tags by extracting the src URL
from the JSON payload and producing AST::Image nodes. Also handles
bare [IMG2]url[/IMG2] without JSON. Includes unit and integration tests.
…Presenter

- Use Ruby 3.1+ hash shorthand in Img2Handler (src: instead of src: src)
- Fix img2_handler_spec to use AST::Text#text instead of nonexistent #value
- Add Table to ASTPresenter's CATEGORY_MAP and ICON_MAP
@gschlager
Copy link
Copy Markdown
Member

Discourse which has no table syntax

Discourse supports both Markdown and HTML tables, so we should aim to preserve tables rather than flatten or discard them.

Add [IMG2] BBCode handler for vBulletin 5 enhanced image tags

I need to think this through. I’m torn between two approaches: either keeping this out of the gem and handling it at a higher level (e.g. in our converter), or introducing configurable BBCode dialects that can extend or override handlers as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants