샘플
markdown-it 14.3.1
검증된 샘플 — npm markdown-it 14.3.1. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: MarkdownIt is exported and can be instantiated with default…
sha256:21bfca448a81bcec7fc1e6b4309fc4779e9e9b70a166ba3a14d4efec36e50924
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-19 |
케이스
HOW- 목표
- verify pkg:npm/markdown-it@14.3.1
- 생성일
- 2026-09-17T21:46:58Z
컨트랙트
- MarkdownIt is exported and can be instantiated with default options
- MarkdownIt.render converts headings, paragraphs, lists, and inline formatting into HTML
- MarkdownIt.renderInline converts inline formatting without wrapping in block elements
- MarkdownIt respects configuration options such as html, linkify, and breaks
- MarkdownIt.use allows plugin registration and custom token rule extensions
파일
- PROMPT.md
- csx.json
- index.mjs
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
소스
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:npm/markdown-it@14.3.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/markdown-it@14.3.1
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:7662b52b89eec92853f0bb2702f4cd2ec4706459de2126ae73ada5c06a80aede","contract":["MarkdownIt is exported and can be instantiated with default options","MarkdownIt.render converts headings, paragraphs, lists, and inline formatting into HTML","MarkdownIt.renderInline converts inline formatting without wrapping in block elements","MarkdownIt respects configuration options such as html, linkify, and breaks","MarkdownIt.use allows plugin registration and custom token rule extensions"],"goal":"verify pkg:npm/markdown-it@14.3.1","kind":"HOW","packages":["pkg:npm/markdown-it@14.3.1"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/markdown-it@14.3.1"],"schemaVersion":1,"subject":"pkg:npm/markdown-it@14.3.1","verifierAdapter":"node-typescript@1"}
import MarkdownIt from 'markdown-it';
/**
* Creates a configured MarkdownIt instance.
*
* @param {Object} [options] - MarkdownIt configuration options.
* @returns {MarkdownIt} Instance of MarkdownIt.
*/
export function createRenderer(options) {
return new MarkdownIt(options);
}
/**
* Renders a Markdown string to an HTML block.
*
* @param {string} source - Markdown text to render.
* @param {Object} [options] - MarkdownIt configuration options.
* @returns {string} Rendered HTML string.
*/
export function renderMarkdown(source, options) {
const md = new MarkdownIt(options);
return md.render(source);
}
/**
* Renders an inline Markdown string to HTML without block-level wrapper tags.
*
* @param {string} source - Inline markdown text to render.
* @param {Object} [options] - MarkdownIt configuration options.
* @returns {string} Rendered HTML string.
*/
export function renderInlineMarkdown(source, options) {
const md = new MarkdownIt(options);
return md.renderInline(source);
}
export default MarkdownIt;
{
"name": "sample-markdown-it",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-markdown-it",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"markdown-it": "14.3.1"
}
},
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"license": "Python-2.0"
},
"node_modules/entities": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=0.12"
},
"funding": {
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/linkify-it": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.2.tgz",
"integrity": "sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/puzrin"
},
{
"type": "github",
"url": "https://github.com/sponsors/markdown-it"
}
],
"license": "MIT",
"dependencies": {
"uc.micro": "^2.0.0"
}
},
"node_modules/markdown-it": {
"version": "14.3.1",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.3.1.tgz",
"integrity": "sha512-4Ej49aYTDFIQ+uBkfX8GBvJGccoARxxPep+7aWTs55ozbjQJpW9M26Fe53vnGgvLeVzva/amzjQQaQu9w0vMhA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/puzrin"
},
{
"type": "github",
"url": "https://github.com/sponsors/markdown-it"
}
],
"license": "MIT",
"dependencies": {
"argparse": "^2.0.1",
"entities": "^4.5.0",
"linkify-it": "^5.0.2",
"mdurl": "^2.0.0",
"punycode.js": "^2.3.1",
"uc.micro": "^2.1.0"
},
"bin": {
"markdown-it": "bin/markdown-it.mjs"
}
},
"node_modules/mdurl": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.1.0.tgz",
"integrity": "sha512-1+HBaOx0zi/dQWht8rNv9MYf9qqpqL/kxI0hXImU6Y547zM6Sni8BQibt7ifgMcYtQg41ao3Ivd6cnSM86inpg==",
"license": "MIT"
},
"node_modules/punycode.js": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz",
"integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/uc.micro": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz",
"integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==",
"license": "MIT"
}
}
}
{
"name": "sample-markdown-it",
"version": "1.0.0",
"type": "module",
"description": "Clean-room sample verifying pkg:npm/markdown-it@14.3.1 functionality",
"main": "index.mjs",
"license": "MIT-0",
"scripts": {
"test": "node test/contract.mjs"
},
"dependencies": {
"markdown-it": "14.3.1"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/markdown-it@14.3.1",
"kind": "HOW",
"packages": [
"pkg:npm/markdown-it@14.3.1"
]
}
import assert from 'node:assert/strict';
import MarkdownIt, { createRenderer, renderMarkdown, renderInlineMarkdown } from '../index.mjs';
// 1. MarkdownIt is exported and can be instantiated with default options
const mdDefault = createRenderer();
assert.equal(typeof MarkdownIt, 'function');
assert.ok(mdDefault instanceof MarkdownIt);
assert.equal(typeof mdDefault.render, 'function');
assert.equal(typeof mdDefault.renderInline, 'function');
// 2. MarkdownIt.render converts headings, paragraphs, lists, and inline formatting into HTML
const headingHtml = renderMarkdown('# Hello World');
assert.equal(headingHtml, '<h1>Hello World</h1>\n');
const paragraphHtml = renderMarkdown('This is **bold** and *italic*.');
assert.equal(paragraphHtml, '<p>This is <strong>bold</strong> and <em>italic</em>.</p>\n');
const listMarkdown = '- item 1\n- item 2\n';
const listHtml = renderMarkdown(listMarkdown);
assert.equal(listHtml, '<ul>\n<li>item 1</li>\n<li>item 2</li>\n</ul>\n');
const codeMarkdown = '```js\nconsole.log(42);\n```';
const codeHtml = renderMarkdown(codeMarkdown);
assert.ok(codeHtml.includes('<pre><code class="language-js">console.log(42);\n</code></pre>\n'));
// 3. MarkdownIt.renderInline converts inline formatting without wrapping in block elements
const inlineBold = renderInlineMarkdown('**inline bold**');
assert.equal(inlineBold, '<strong>inline bold</strong>');
const inlineCode = renderInlineMarkdown('`inline code`');
assert.equal(inlineCode, '<code>inline code</code>');
assert.ok(!inlineBold.startsWith('<p>') && !inlineBold.endsWith('</p>\n'));
// 4. MarkdownIt respects configuration options such as html, linkify, and breaks
const mdNoHtml = createRenderer({ html: false });
assert.equal(mdNoHtml.render('<div>safe</div>'), '<p><div>safe</div></p>\n');
const mdHtml = createRenderer({ html: true });
assert.equal(mdHtml.render('<div>raw</div>'), '<div>raw</div>');
const mdLinkify = createRenderer({ linkify: true });
assert.equal(
mdLinkify.render('Visit https://example.com for info.'),
'<p>Visit <a href="https://example.com">https://example.com</a> for info.</p>\n'
);
const mdBreaks = createRenderer({ breaks: true });
assert.equal(mdBreaks.render('first line\nsecond line'), '<p>first line<br>\nsecond line</p>\n');
// 5. MarkdownIt.use allows plugin registration and custom token rule extensions
const customPlugin = md => {
md.core.ruler.push('test_plugin', state => {
state.env.pluginApplied = true;
});
};
const mdPlugin = createRenderer();
mdPlugin.use(customPlugin);
const env = {};
mdPlugin.render('Testing plugin', env);
assert.equal(env.pluginApplied, true);
console.log('All markdown-it contract assertions passed.');
오리진 시더
익명