Add emoji shortcode conversion and enforce Slack table limits - #8
Merged
Conversation
Convert emoji shortcodes (e.g. 📊) into native RichTextSectionEmojiElement objects so Slack renders them as actual emojis. Goldmark's emphasis parser splits text at underscores, fragmenting shortcodes — resolveEmojis() merges adjacent same-style text elements before scanning for shortcodes. Numeric-only patterns like :49: from timestamps are rejected to avoid Slack invalid_blocks errors. Enforce Slack TableBlock API limits: tables exceeding 100 rows are split into multiple TableBlocks (each carrying the same header), and columns beyond 20 are silently truncated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Skip emoji shortcode scanning for code-styled text elements so backtick-wrapped shortcodes like `:fire:` render as literal text - Fix misleading comments on emojiShortcodeRe and isValidEmojiName - Simplify paragraph path to reuse flushInlineToSection() - Add tests: emoji in code spans, adjacent valid/invalid shortcodes, emoji in table cells, 101-row off-by-one boundary Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
:bar_chart:,:+1:,:wave:) into nativeRichTextSectionEmojiElementobjects — Slack renders plain text shortcodes as literal text, not emojis:bar_chart:→:bar_+chart:):49:from timestamps like19:49:41) that cause Slackinvalid_blockserrorsChanges
emojiShortcodeRe,isValidEmojiName(),resolveEmojis(),mergeAdjacentText(),stylesEqual(). UpdatedflushInlineToSection()to resolve emojis before flushing.resolveEmojis()in blockquote accumulation and paragraph emission paths.maxTableRows/maxTableColumnsconstants. RenamedrenderTableBlock→renderTableBlockswith row splitting, column truncation, and extractedbuildColumnSettings()/truncateRow()helpers.Test plan
go test ./... -v)go vet ./...cleanConvert()andChunkBlocks()signatures unchanged🤖 Generated with Claude Code