Files
bip-kit/package.json
T
CatoandClaude Opus 5 1adfef61f6 fix(inline): honor backslash escapes, intraword *, and ***bold italic*** (v0.2.2) (#22)
evig's adoption parity check (old react-markdown output vs bip-kit's typed
blocks) found three classes where the inline scanner silently under-parsed
against standard markdown. Fixed here rather than worked around in every
consumer.

The single-pass "find the next matching delimiter" scanner could not express
any of them, so emphasis now runs as CommonMark does it: tokenize the line
into nodes and unresolved delimiter runs, then resolve the runs in a second
pass (process_emphasis — nearest eligible opener, two delimiters for strong,
one for em, rule of three). Escapes, code spans, links and footnote refs are
settled during tokenization, so a `\*` is inert text that can never open
markup and a code span still takes no escapes at all.

- Backslash escapes: the full CommonMark ASCII punctuation set. `\*x\*` is
  literal, `\\` is one backslash, and a backslash before a non-escapable
  character stays a backslash (`C:\path\to`).
- Intraword emphasis: `*` may open and close intraword (`foo*bar*baz`), `_`
  may not — `snake_case_name` and friends stay literal, pinned by test.
- `***x***`, `___x___`, `**_x_**`, `_**x**_` produce nested strong+em instead
  of a literal run of asterisks.

Zero new dependencies; still a hand-rolled scanner over one line. Unmatched
and dangling delimiters stay literal exactly as before.

ONE existing test pinned the old, non-CommonMark behavior and is updated:
"intraword underscores and asterisks are not emphasis" asserted that
`2*3*4 = 24` stayed literal text. Under CommonMark's flanking rules that is
`2<em>3</em>4 = 24`, which is what react-markdown and every other reader
emits, and what the parity check flagged. The underscore half of that
assertion is untouched and now has more cases around it.

Tests 116 -> 126.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 12:48:28 +00:00

99 lines
2.3 KiB
JSON

{
"name": "bip-kit",
"version": "0.2.2",
"description": "Building in Public, as a content contract: parse markdown into typed blocks and render them with a reference React renderer (bip-kit/react) — blog, roadmap, changelog on your product site, bring your own design tokens.",
"license": "MIT",
"author": "Mao Nakamoto",
"homepage": "https://github.com/bitbaum/bip-kit#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/bitbaum/bip-kit.git"
},
"bugs": {
"url": "https://github.com/bitbaum/bip-kit/issues"
},
"keywords": [
"build-in-public",
"blog",
"roadmap",
"changelog",
"markdown",
"headless",
"content",
"nextjs",
"react",
"rsc",
"renderer"
],
"type": "module",
"sideEffects": false,
"packageManager": "pnpm@11.25.0",
"engines": {
"node": ">=20"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"files": [
"dist",
"styles.css"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./react": {
"types": "./dist/react/index.d.ts",
"default": "./dist/react/index.js"
},
"./react/mermaid": {
"types": "./dist/react/mermaid.d.ts",
"default": "./dist/react/mermaid.js"
},
"./styles.css": "./styles.css"
},
"scripts": {
"build": "tsc -p tsconfig.json",
"lint": "eslint .",
"typecheck": "tsc -p tsconfig.json --noEmit",
"test": "node --test test/*.test.js",
"verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm test",
"prepare": "pnpm run build",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/node": "^26.4.0",
"@types/react": "^19.2.18",
"eslint": "^10.9.1",
"globals": "^17.11.0",
"katex": "^0.18.5",
"prettier": "^3.9.6",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"shiki": "^4.4.3",
"typescript": "^6.0.3",
"typescript-eslint": "^8.68.0"
},
"peerDependencies": {
"react": ">=18",
"shiki": ">=1",
"mermaid": ">=10",
"katex": ">=0.16"
},
"peerDependenciesMeta": {
"shiki": {
"optional": true
},
"mermaid": {
"optional": true
},
"katex": {
"optional": true
}
}
}