Markdown
<Markdown />GitHub's markdown set in the kit's type, with fenced code as CodeBlocks.
Three things changed in cart.ts:
- The loop bound is
i < items.length - Totals are summed in cents, not floats
- A test covers the two-item case
| Items | Before | After |
|---|---|---|
| 1 | 12.00 | 12.00 |
| 2 | 12.00 | 30.00 |
All 48 tests pass.
Install
bash
npx shadcn@latest add https://orbeez-kit.vercel.app/r/markdown.jsonUsage
tsx
<Markdown>{answer}</Markdown>
// while it streams: hold back half-written lines and draw the caret
<Markdown streaming={!done}>{answerSoFar}</Markdown>Good to know
- streaming holds back a last line that is only markdown so far, like "- *", which would otherwise parse as a list inside a list and snap back a character later.