Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-mrkdwn-directives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"slack-blocks-to-jsx": patch
---

Resolve Slack directive atoms (`<@U…>`, `<#C…>`, `<!subteam^…>`, `<!channel|here|everyone>`, `<!date^…>`) in `section`/`mrkdwn` text and other mrkdwn-typed text. Directives now fire the same hooks as the `rich_text` path. `verbatim: true` matches Slack's empirical behavior — it suppresses bare-form `@here` / `@channel` / `@everyone` interpolation but is otherwise a no-op (markdown sugar, code spans, angle-bracket URLs, and structured `<!…>` directives all render the same in both modes). HTML entity decoding (`&lt;`, `&gt;`, `&amp;`) is deferred from input pre-processing to leaf renderers, so escaped sequences like `&lt;@U123&gt;` (user typed `<@U123>` literally) stay literal instead of being incorrectly resolved as a user mention — matching Slack's renderer.
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"dev:css": "postcss ./src/style.css -o ./dist/style.css --watch",
"dev": "tsup --watch",
"lint": "tsc",
"test": "node --test \"test/**/*.test.mjs\"",
"test": "vitest run && node --test \"test/**/*.test.mjs\"",
"test:watch": "vitest",
"release": "node scripts/release.mjs",
"release:dry": "node scripts/release.mjs --dry-run",
"release:beta": "node scripts/release.mjs prerelease --preid=beta",
Expand All @@ -44,19 +45,24 @@
"react-dom": "^17 || ^18 || ^19"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@types/react": "^17 || ^18 || ^19",
"@types/react-dom": "^17 || ^18 || ^19",
"@vitejs/plugin-react": "^6.0.2",
"@yozora/ast": "^2.3.2",
"@yozora/character": "^2.3.2",
"@yozora/core-tokenizer": "^2.3.2",
"@yozora/parser": "^2.3.2",
"@types/react": "^17 || ^18 || ^19",
"@types/react-dom": "^17 || ^18 || ^19",
"autoprefixer": "^10.4.17",
"cssnano": "^6.0.3",
"happy-dom": "^20.9.0",
"postcss": "^8.4.33",
"postcss-cli": "^11.0.0",
"postcss-nesting": "^12.0.2",
"tailwindcss": "^3.4.1",
"tsup": "^8.5.0",
"typescript": "^5.2.2"
"typescript": "^5.2.2",
"vitest": "^4.1.6"
}
}
Loading
Loading