Improve Markdown compatibility within bundle budgets and automate releases #14
Mergedtannerlinsleymerged 2 commits into
main fromtaren/markdown-auditmerged by tannerlinsley tannerlinsley merged this04f450c
tannerlinsley closed this
- @@ -0,0 +56,21 @@56+| TanStack | Core | 1 | 0 | 0 | 0 |57+| TanStack | Docs extensions | 23 | 0 | 0 | 0 |58+59+These are profile-specific comparisons, not counts of unique newly supported documents. Existing differences against Marked remain, including unsupported syntax and intentional extensions. A zero in the last column means the classifier found no newly introduced content-difference category, not proof of identical browser behavior.60+61+## Remaining Work62+63+Balanced, fence-aware comment components and elimination of their repeated unmatched scans. This pass reduces allocation, not their worst-case complexity.64+Container-aware reference-definition collection, including fences opened on list-marker lines.65+Collision-free IDs when repeated footnote references overlap another footnote's normalized name. Existing IDs were not renamed to work around the collision.66+Further destination grammar, emphasis precedence, hard breaks, and quoted HTML handling.67+Inline Markdown in callout titles. A quote-separation prototype gained one CommonMark example but made an existing link-bearing custom title render literally. That change was removed, preserving the existing quote grouping until both behaviors can be handled together.68+Browser hydration, allocation profiling, and long-running streaming UI measurements. Node and SSR benchmarks do not establish these properties.69+70+## Reproduce71+72+```bash73+pnpm run verify74+node --import tsx scripts/audit-external-corpus.ts75+node --import tsx scripts/audit-tanstack-corpus.ts76+node --import tsx scripts/compare-revision.mjs /private/tmp/markdown-compat-baseline.Ql4J5n --corpus@@ -0,0 +32,21 @@32+}33+34+async function bundle(contents, previous, external = [], format = 'esm') {35+ const result = await build({36+ stdin: { contents, resolveDir: root, loader: 'ts' },37+ bundle: true,38+ write: false,39+ minify: true,40+ treeShaking: true,41+ platform: 'browser',42+ format,43+ target: 'es2022',44+ external,45+ plugins: previous ? [baselinePlugin] : [],46+ logLevel: 'silent',47+ })48+ return result.outputFiles[0].contents49+}50+51+const sizes = []52+for (const entry of [...entries.filter(entry => entry.group === 'tanstack'), ...publicEntries]) {@@ -110,9 +105,10 @@110105 }111106112107 function renderListItemChildren(children: BlockNode[], checked: boolean | undefined, loose: boolean | undefined, options: RenderOptions): string {113- const first = children[0]114- const task = checked === undefined ? '' : `<input type="checkbox" disabled${checked ? ' checked' : ''}> `115- if (first?.type === 'paragraph') {116- const content = `${task}${renderInlines(first.children, options)}`117- const rest = children.length > 1 ? `\n${children.slice(1).map(child => renderBlock(child, options)).join('\n')}` : ''118- return `${loose ? `<p>${content}</p>` : content}${rest}`108+ let result = checked === undefined ? '' : `<input type="checkbox" disabled${checked ? ' checked' : ''}> `109+ for (let index = 0; index < children.length; index++) {110+ const child = children[index]!111+ if (child.type === 'paragraph' && (!loose || index === 0)) {112+ result += renderInlines(child.children, options)113+ if (loose) result = `<p>${result}</p>`114+ } else result += (index ? '\n' : '') + renderBlock(child, options)@@ -141,18 +133,10 @@141- })142- index = close + 2143- continue144- }145- text += char + next146- index += 2147- continue148- }149-150133 if (char === '~' && next === '~' && value[index + 2] === '~') {151134 const run = countRun(value, index, '~')152135 text += value.slice(index, index + run)153136 index += run154137 continue155138 }156139157- if (char === '~' && next === '~') {158- const close = findDelimiter(value, index + 2, '~~', budget)140+ if (char === '*' || char === '_' || char === '~') {141+ const size = next === char ? 2 : 1142+ const close = char === '_' && !canUseUnderscore(value, index, size, true) ? -1 : findDelimiter(value, index + size, char.repeat(size), budget)@@ -51,7 +51,8 @@5151 }5252 : options535354- const parser = new BlockParser(lines, parseOptions, createSlugger())54+ const slugger = createSlugger()55+ const parser = new BlockParser(lines, parseOptions, slugger)5556 const children = parser.parse()5657 if (hasFootnotes && footnoteOrder.length > 0) {57- children.push(createFootnotesBlock(definitions.footnotes, footnoteOrder, parseOptions))58+ children.push(createFootnotesBlock(definitions.footnotes, footnoteOrder, parseOptions, slugger))
Sign in to join this conversation.
📝 Walkthrough
Walkthrough#
The change improves Markdown compatibility across parsing and rendering, adds regression and bundle-size validation, refreshes benchmark and corpus reports, and introduces Changesets-based release automation.
Changes#
Markdown compatibility and release automation
src/parser.ts,src/inline.ts,src/utils.ts,src/extensions/*src/html.ts,src/react.ts,src/octane.tstests/*,scripts/*reports/*,README.md,docs/*.changeset/*,.github/workflows/*,package.json,CONTRIBUTING.mdPriority: ⬇️ Low
Estimated code review effort: 5 (Critical) | ~90 minutes
Change: Bug fix
Merge Risk: 🟡 Moderate · up to
a2ac5The release can render malformed Markdown output and misdirect footnote links, while validation may miss removed public exports. Resolve these issues before merge.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 77 functions across 17 files. (24 skipped: 24 unsupported.)
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share