FIX: Add table tag passthrough support and fix quote trailing newlines#4
Open
RubenOussoren wants to merge 5 commits intomainfrom
Open
FIX: Add table tag passthrough support and fix quote trailing newlines#4RubenOussoren wants to merge 5 commits intomainfrom
RubenOussoren wants to merge 5 commits intomainfrom
Conversation
Contributor
RubenOussoren
commented
Mar 10, 2026
- 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
52e9b52 to
001c5c2
Compare
c8531b1 to
e9c9544
Compare
- 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
001c5c2 to
66379b3
Compare
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
Member
Discourse supports both Markdown and HTML tables, so we should aim to preserve tables rather than flatten or discard them.
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. |
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.