v0.4.26.3 — Slack render_postable AST fix
·
82 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Python-only patch on top of vercel/chat@4.26.0. No upstream version change.
Fixes
SlackFormatConverter.render_postablenow uses the AST path for all markdown inputs (#81). Previously,PostableMarkdownand{"markdown": ...}dict inputs were routed through a private regex helper (_markdown_to_mrkdwn) that truncated URLs containing parentheses and diverged silently from the TS SDK'sfromAst(parseMarkdown(text))behavior. Both branches now callfrom_markdown, which goes through the AST.strandrawbranches are unchanged.
Structural parity
- Deleted
_markdown_to_mrkdwn— a regex-based private method with no call sites after the fix above. The TS SDK has no equivalent; its presence was an undocumented divergence.
Additions
render_postablenow handles card and object-with-ast inputs — added{"card": ...}dict,{"type": "card", ...}CardElementdict,{"ast": ...}dict, and.card/.astattribute branches, plusstr(message)fallback for unrecognized types. Matches the full union ofAdapterPostableMessagevariants.
Test quality
19 new tests in tests/test_slack_format.py (47 → 66) covering all render_postable branches, every _node_to_mrkdwn node type (heading, blockquote, thematic break, image with/without alt), the remaining extract_plain_text paths (strikethrough, bare URL, channel mentions), and to_blocks_with_table edge cases (non-dict AST, standalone table, column alignment).