{"name":"prosemirror-markdown","version":"1.13.2","license":"MIT","_id":"prosemirror-markdown@1.13.2","maintainers":[{"name":"marijn","email":"marijn@haverbeke.berlin"}],"homepage":"https://github.com/prosemirror/prosemirror-markdown#readme","bugs":{"url":"https://github.com/prosemirror/prosemirror-markdown/issues"},"dist":{"shasum":"863eb3fd5f57a444e4378174622b562735b1c503","tarball":"http://registry-npm.ywwl.com/prosemirror-markdown/download/prosemirror-markdown-1.13.2.tgz","fileCount":15,"integrity":"sha512-FPD9rHPdA9fqzNmIIDhhnYQ6WgNoSWX9StUZ8LEKapaXU9i6XgykaHKhp6XMyXlOWetmaFgGDS/nu/w9/vUc5g==","signatures":[{"sig":"MEUCIB2mrEaoCjGxcIaMmDf81Qo9kVDNkWV5ZlLWU9kDcxfVAiEAnBkqj+6DAosKUTeX3zGvSpXuXLqEF3chZMK1ciWKKTo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":161841,"size":36738,"noattachment":false,"key":"/prosemirror-markdown/-/prosemirror-markdown-1.13.2.tgz"},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"gitHead":"d671c2305446248f2c1138ea355b6c7e0bafc1f7","scripts":{"test":"pm-runtests","prepare":"pm-buildhelper src/index.ts"},"_npmUser":{"name":"marijn","email":"marijn@haverbeke.berlin"},"repository":{"url":"git://github.com/prosemirror/prosemirror-markdown.git","type":"git"},"_npmVersion":"10.9.2","description":"ProseMirror Markdown integration","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"markdown-it":"^14.0.0","prosemirror-model":"^1.25.0","@types/markdown-it":"^14.0.0"},"_hasShrinkwrap":false,"devDependencies":{"punycode":"^1.4.0","@prosemirror/buildhelper":"^0.1.5","prosemirror-test-builder":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/prosemirror-markdown_1.13.2_1742285745104_0.0929585956297867","host":"s3://npm-registry-packages-npm-production"},"readme":"<h1>prosemirror-markdown</h1>\n<p>[ <a href=\"http://prosemirror.net\"><strong>WEBSITE</strong></a> | <a href=\"https://code.haverbeke.berlin/prosemirror/prosemirror-markdown/issues\"><strong>ISSUES</strong></a> | <a href=\"https://discuss.prosemirror.net\"><strong>FORUM</strong></a> | <a href=\"https://gitter.im/ProseMirror/prosemirror\"><strong>GITTER</strong></a> ]</p>\n<p>This is a (non-core) module for <a href=\"http://prosemirror.net\">ProseMirror</a>.\nProseMirror is a well-behaved rich semantic content editor based on\ncontentEditable, with support for collaborative editing and custom\ndocument schemas.</p>\n<p>This module implements a ProseMirror\n<a href=\"https://prosemirror.net/docs/guide/#schema\">schema</a> that corresponds to\nthe document schema used by <a href=\"http://commonmark.org/\">CommonMark</a>, and\na parser and serializer to convert between ProseMirror documents in\nthat schema and CommonMark/Markdown text.</p>\n<p>This code is released under an\n<a href=\"https://code.haverbeke.berlin/prosemirror/prosemirror/src/branch/main/LICENSE\">MIT license</a>.\nThere's a <a href=\"http://discuss.prosemirror.net\">forum</a> for general\ndiscussion and support requests, and the\n<a href=\"https://code.haverbeke.berlin/prosemirror/prosemirror/issues\">bug tracker</a>\nis the place to report issues.</p>\n<p>We aim to be an inclusive, welcoming community. To make that explicit,\nwe have a <a href=\"http://contributor-covenant.org/version/1/1/0/\">code of\nconduct</a> that applies\nto communication around the project.</p>\n<h2>Documentation</h2>\n<dl>\n<dt id=\"schema\">\n  <code><strong><a href=\"#schema\">schema</a></strong>: <span class=\"type\">Schema</span>&lt;<span class=\"string\">&quot;doc&quot;</span> | <span class=\"string\">&quot;paragraph&quot;</span> | <span class=\"string\">&quot;blockquote&quot;</span> | <span class=\"string\">&quot;horizontal_rule&quot;</span> | <span class=\"string\">&quot;heading&quot;</span> | <span class=\"string\">&quot;code_block&quot;</span> | <span class=\"string\">&quot;ordered_list&quot;</span> | <span class=\"string\">&quot;bullet_list&quot;</span> | <span class=\"string\">&quot;list_item&quot;</span> | <span class=\"string\">&quot;text&quot;</span> | <span class=\"string\">&quot;image&quot;</span> | <span class=\"string\">&quot;hard_break&quot;</span>, <span class=\"string\">&quot;em&quot;</span> | <span class=\"string\">&quot;strong&quot;</span> | <span class=\"string\">&quot;link&quot;</span> | <span class=\"string\">&quot;code&quot;</span>&gt;</code></dt>\n\n<dd><p>Document schema for the data model used by CommonMark.</p>\n</dd>\n<dt id=\"MarkdownParser\">\n  <h4>\n    <code><span class=keyword>class</span></code>\n    <a href=\"#MarkdownParser\">MarkdownParser</a></h4>\n</dt>\n\n<dd><p>A configuration of a Markdown parser. Such a parser uses\n<a href=\"https://github.com/markdown-it/markdown-it\">markdown-it</a> to\ntokenize a file, and then runs the custom rules it is given over\nthe tokens to create a ProseMirror document tree.</p>\n<dl><dt id=\"MarkdownParser.constructor\">\n  <code><span class=keyword>new</span> <strong><a href=\"#MarkdownParser.constructor\">MarkdownParser</a></strong>(<a id=\"MarkdownParser.constructor^schema\" href=\"#MarkdownParser.constructor^schema\"><span class=param>schema</span></a>: <span class=\"type\">Schema</span>, <a id=\"MarkdownParser.constructor^tokenizer\" href=\"#MarkdownParser.constructor^tokenizer\"><span class=param>tokenizer</span></a>: <span class=\"type\">any</span>, <a id=\"MarkdownParser.constructor^tokens\" href=\"#MarkdownParser.constructor^tokens\"><span class=param>tokens</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a>&lt;<a href=\"#ParseSpec\"><span class=\"type\">ParseSpec</span></a>&gt;)</code></dt>\n\n<dd><p>Create a parser with the given configuration. You can configure\nthe markdown-it parser to parse the dialect you want, and provide\na description of the ProseMirror entities those tokens map to in\nthe <code>tokens</code> object, which maps token names to descriptions of\nwhat to do with them. Such a description is an object, and may\nhave the following properties:</p>\n</dd><dt id=\"MarkdownParser.schema\">\n  <code><strong><a href=\"#MarkdownParser.schema\">schema</a></strong>: <span class=\"type\">Schema</span></code></dt>\n\n<dd><p>The parser's document schema.</p>\n</dd><dt id=\"MarkdownParser.tokenizer\">\n  <code><strong><a href=\"#MarkdownParser.tokenizer\">tokenizer</a></strong>: <span class=\"type\">any</span></code></dt>\n\n<dd><p>This parser's markdown-it tokenizer.</p>\n</dd><dt id=\"MarkdownParser.tokens\">\n  <code><strong><a href=\"#MarkdownParser.tokens\">tokens</a></strong>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a>&lt;<a href=\"#ParseSpec\"><span class=\"type\">ParseSpec</span></a>&gt;</code></dt>\n\n<dd><p>The value of the <code>tokens</code> object used to construct this\nparser. Can be useful to copy and modify to base other parsers\non.</p>\n</dd><dt id=\"MarkdownParser.parse\">\n  <code><strong><a href=\"#MarkdownParser.parse\">parse</a></strong>(<a id=\"MarkdownParser.parse^text\" href=\"#MarkdownParser.parse^text\"><span class=param>text</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>) → <span class=\"type\">any</span></code></dt>\n\n<dd><p>Parse a string as <a href=\"http://commonmark.org/\">CommonMark</a> markup,\nand create a ProseMirror document as prescribed by this parser's\nrules.</p>\n</dd></dl>\n\n</dd>\n<dt id=\"ParseSpec\">\n  <h4>\n    <code><span class=keyword>interface</span></code>\n    <a href=\"#ParseSpec\">ParseSpec</a></h4>\n</dt>\n\n<dd><p>Object type used to specify how Markdown tokens should be parsed.</p>\n<dl><dt id=\"ParseSpec.node\">\n  <code><strong><a href=\"#ParseSpec.node\">node</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a></code></dt>\n\n<dd><p>This token maps to a single node, whose type can be looked up\nin the schema under the given name. Exactly one of <code>node</code>,\n<code>block</code>, or <code>mark</code> must be set.</p>\n</dd><dt id=\"ParseSpec.block\">\n  <code><strong><a href=\"#ParseSpec.block\">block</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a></code></dt>\n\n<dd><p>This token (unless <code>noCloseToken</code> is true) comes in <code>_open</code>\nand <code>_close</code> variants (which are appended to the base token\nname provides a the object property), and wraps a block of\ncontent. The block should be wrapped in a node of the type\nnamed to by the property's value. If the token does not have\n<code>_open</code> or <code>_close</code>, use the <code>noCloseToken</code> option.</p>\n</dd><dt id=\"ParseSpec.mark\">\n  <code><strong><a href=\"#ParseSpec.mark\">mark</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a></code></dt>\n\n<dd><p>This token (again, unless <code>noCloseToken</code> is true) also comes\nin <code>_open</code> and <code>_close</code> variants, but should add a mark\n(named by the value) to its content, rather than wrapping it\nin a node.</p>\n</dd><dt id=\"ParseSpec.attrs\">\n  <code><strong><a href=\"#ParseSpec.attrs\">attrs</a></strong>&#8288;?: <span class=\"type\">Attrs</span></code></dt>\n\n<dd><p>Attributes for the node or mark. When <code>getAttrs</code> is provided,\nit takes precedence.</p>\n</dd><dt id=\"ParseSpec.getAttrs\">\n  <code><strong><a href=\"#ParseSpec.getAttrs\">getAttrs</a></strong>&#8288;?: <span class=fn>fn</span>(<a id=\"ParseSpec.getAttrs^token\" href=\"#ParseSpec.getAttrs^token\"><span class=param>token</span></a>: <span class=\"type\">any</span>, <a id=\"ParseSpec.getAttrs^tokenStream\" href=\"#ParseSpec.getAttrs^tokenStream\"><span class=param>tokenStream</span></a>: <span class=\"type\">any</span>[], <a id=\"ParseSpec.getAttrs^index\" href=\"#ParseSpec.getAttrs^index\"><span class=param>index</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><span class=\"prim\">number</span></a>) → <span class=\"type\">Attrs</span></code></dt>\n\n<dd><p>A function used to compute the attributes for the node or mark\nthat takes a <a href=\"https://markdown-it.github.io/markdown-it/#Token\">markdown-it\ntoken</a> and\nreturns an attribute object.</p>\n</dd><dt id=\"ParseSpec.noCloseToken\">\n  <code><strong><a href=\"#ParseSpec.noCloseToken\">noCloseToken</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\"><span class=\"prim\">boolean</span></a></code></dt>\n\n<dd><p>Indicates that the <a href=\"https://markdown-it.github.io/markdown-it/#Token\">markdown-it\ntoken</a> has\nno <code>_open</code> or <code>_close</code> for the nodes. This defaults to <code>true</code>\nfor <code>code_inline</code>, <code>code_block</code> and <code>fence</code>.</p>\n</dd><dt id=\"ParseSpec.ignore\">\n  <code><strong><a href=\"#ParseSpec.ignore\">ignore</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\"><span class=\"prim\">boolean</span></a></code></dt>\n\n<dd><p>When true, ignore content for the matched token.</p>\n</dd></dl>\n\n</dd>\n<dt id=\"defaultMarkdownParser\">\n  <code><strong><a href=\"#defaultMarkdownParser\">defaultMarkdownParser</a></strong>: <a href=\"#MarkdownParser\"><span class=\"type\">MarkdownParser</span></a></code></dt>\n\n<dd><p>A parser parsing unextended <a href=\"http://commonmark.org/\">CommonMark</a>,\nwithout inline HTML, and producing a document in the basic schema.</p>\n</dd>\n<dt id=\"MarkdownSerializer\">\n  <h4>\n    <code><span class=keyword>class</span></code>\n    <a href=\"#MarkdownSerializer\">MarkdownSerializer</a></h4>\n</dt>\n\n<dd><p>A specification for serializing a ProseMirror document as\nMarkdown/CommonMark text.</p>\n<dl><dt id=\"MarkdownSerializer.constructor\">\n  <code><span class=keyword>new</span> <strong><a href=\"#MarkdownSerializer.constructor\">MarkdownSerializer</a></strong>(<a id=\"MarkdownSerializer.constructor^nodes\" href=\"#MarkdownSerializer.constructor^nodes\"><span class=param>nodes</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a>&lt;<span class=fn>fn</span>(<a id=\"MarkdownSerializer.constructor^nodes^state\" href=\"#MarkdownSerializer.constructor^nodes^state\"><span class=param>state</span></a>: <a href=\"#MarkdownSerializerState\"><span class=\"type\">MarkdownSerializerState</span></a>, <a id=\"MarkdownSerializer.constructor^nodes^node\" href=\"#MarkdownSerializer.constructor^nodes^node\"><span class=param>node</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializer.constructor^nodes^parent\" href=\"#MarkdownSerializer.constructor^nodes^parent\"><span class=param>parent</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializer.constructor^nodes^index\" href=\"#MarkdownSerializer.constructor^nodes^index\"><span class=param>index</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><span class=\"prim\">number</span></a>)&gt;, <a id=\"MarkdownSerializer.constructor^marks\" href=\"#MarkdownSerializer.constructor^marks\"><span class=param>marks</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a>&lt;<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a>&gt;, <a id=\"MarkdownSerializer.constructor^options\" href=\"#MarkdownSerializer.constructor^options\"><span class=param>options</span></a>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a><span class=defaultvalue> = {}</span>)</code></dt>\n\n<dd><p>Construct a serializer with the given configuration. The <code>nodes</code>\nobject should map node names in a given schema to function that\ntake a serializer state and such a node, and serialize the node.</p>\n<dl><dt id=\"MarkdownSerializer.constructor^options\">\n  <code><strong><a href=\"#MarkdownSerializer.constructor^options\">options</a></strong></code></dt>\n\n<dd><dl><dt id=\"MarkdownSerializer.constructor^options.escapeExtraCharacters\">\n  <code><strong><a href=\"#MarkdownSerializer.constructor^options.escapeExtraCharacters\">escapeExtraCharacters</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><span class=\"type\">RegExp</span></a></code></dt>\n\n<dd><p>Extra characters can be added for escaping. This is passed\ndirectly to String.replace(), and the matching characters are\npreceded by a backslash.</p>\n</dd></dl></dd></dl></dd><dt id=\"MarkdownSerializer.nodes\">\n  <code><strong><a href=\"#MarkdownSerializer.nodes\">nodes</a></strong>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a>&lt;<span class=fn>fn</span>(<a id=\"MarkdownSerializer.nodes^state\" href=\"#MarkdownSerializer.nodes^state\"><span class=param>state</span></a>: <a href=\"#MarkdownSerializerState\"><span class=\"type\">MarkdownSerializerState</span></a>, <a id=\"MarkdownSerializer.nodes^node\" href=\"#MarkdownSerializer.nodes^node\"><span class=param>node</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializer.nodes^parent\" href=\"#MarkdownSerializer.nodes^parent\"><span class=param>parent</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializer.nodes^index\" href=\"#MarkdownSerializer.nodes^index\"><span class=param>index</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><span class=\"prim\">number</span></a>)&gt;</code></dt>\n\n<dd><p>The node serializer functions for this serializer.</p>\n</dd><dt id=\"MarkdownSerializer.marks\">\n  <code><strong><a href=\"#MarkdownSerializer.marks\">marks</a></strong>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a>&lt;<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a>&gt;</code></dt>\n\n<dd><p>The mark serializer info.</p>\n</dd><dt id=\"MarkdownSerializer.options\">\n  <code><strong><a href=\"#MarkdownSerializer.options\">options</a></strong>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a></code></dt>\n\n<dd><dl><dt id=\"MarkdownSerializer.options.escapeExtraCharacters\">\n  <code><strong><a href=\"#MarkdownSerializer.options.escapeExtraCharacters\">escapeExtraCharacters</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><span class=\"type\">RegExp</span></a></code></dt>\n\n<dd><p>Extra characters can be added for escaping. This is passed\ndirectly to String.replace(), and the matching characters are\npreceded by a backslash.</p>\n</dd></dl></dd><dt id=\"MarkdownSerializer.serialize\">\n  <code><strong><a href=\"#MarkdownSerializer.serialize\">serialize</a></strong>(<a id=\"MarkdownSerializer.serialize^content\" href=\"#MarkdownSerializer.serialize^content\"><span class=param>content</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializer.serialize^options\" href=\"#MarkdownSerializer.serialize^options\"><span class=param>options</span></a>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\"><span class=\"type\">Object</span></a><span class=defaultvalue> = {}</span>) → <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a></code></dt>\n\n<dd><p>Serialize the content of the given node to\n<a href=\"http://commonmark.org/\">CommonMark</a>.</p>\n<dl><dt id=\"MarkdownSerializer.serialize^options\">\n  <code><strong><a href=\"#MarkdownSerializer.serialize^options\">options</a></strong></code></dt>\n\n<dd><dl><dt id=\"MarkdownSerializer.serialize^options.tightLists\">\n  <code><strong><a href=\"#MarkdownSerializer.serialize^options.tightLists\">tightLists</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\"><span class=\"prim\">boolean</span></a></code></dt>\n\n<dd><p>Whether to render lists in a tight style. This can be overridden\non a node level by specifying a tight attribute on the node.\nDefaults to false.</p>\n</dd></dl></dd></dl></dd></dl>\n\n</dd>\n<dt id=\"MarkdownSerializerState\">\n  <h4>\n    <code><span class=keyword>class</span></code>\n    <a href=\"#MarkdownSerializerState\">MarkdownSerializerState</a></h4>\n</dt>\n\n<dd><p>This is an object used to track state and expose\nmethods related to markdown serialization. Instances are passed to\nnode and mark serialization methods (see <code>toMarkdown</code>).</p>\n<dl><dt id=\"MarkdownSerializerState.options\">\n  <code><strong><a href=\"#MarkdownSerializerState.options\">options</a></strong>: {<span class=prop>tightLists</span>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\"><span class=\"prim\">boolean</span></a>, <span class=prop>escapeExtraCharacters</span>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><span class=\"type\">RegExp</span></a>}</code></dt>\n\n<dd><p>The options passed to the serializer.</p>\n</dd><dt id=\"MarkdownSerializerState.wrapBlock\">\n  <code><strong><a href=\"#MarkdownSerializerState.wrapBlock\">wrapBlock</a></strong>(<a id=\"MarkdownSerializerState.wrapBlock^delim\" href=\"#MarkdownSerializerState.wrapBlock^delim\"><span class=param>delim</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>, <a id=\"MarkdownSerializerState.wrapBlock^firstDelim\" href=\"#MarkdownSerializerState.wrapBlock^firstDelim\"><span class=param>firstDelim</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>, <a id=\"MarkdownSerializerState.wrapBlock^node\" href=\"#MarkdownSerializerState.wrapBlock^node\"><span class=param>node</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializerState.wrapBlock^f\" href=\"#MarkdownSerializerState.wrapBlock^f\"><span class=param>f</span></a>: <span class=fn>fn</span>())</code></dt>\n\n<dd><p>Render a block, prefixing each line with <code>delim</code>, and the first\nline in <code>firstDelim</code>. <code>node</code> should be the node that is closed at\nthe end of the block, and <code>f</code> is a function that renders the\ncontent of the block.</p>\n</dd><dt id=\"MarkdownSerializerState.ensureNewLine\">\n  <code><strong><a href=\"#MarkdownSerializerState.ensureNewLine\">ensureNewLine</a></strong>()</code></dt>\n\n<dd><p>Ensure the current content ends with a newline.</p>\n</dd><dt id=\"MarkdownSerializerState.write\">\n  <code><strong><a href=\"#MarkdownSerializerState.write\">write</a></strong>(<a id=\"MarkdownSerializerState.write^content\" href=\"#MarkdownSerializerState.write^content\"><span class=param>content</span></a>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>)</code></dt>\n\n<dd><p>Prepare the state for writing output (closing closed paragraphs,\nadding delimiters, and so on), and then optionally add content\n(unescaped) to the output.</p>\n</dd><dt id=\"MarkdownSerializerState.closeBlock\">\n  <code><strong><a href=\"#MarkdownSerializerState.closeBlock\">closeBlock</a></strong>(<a id=\"MarkdownSerializerState.closeBlock^node\" href=\"#MarkdownSerializerState.closeBlock^node\"><span class=param>node</span></a>: <span class=\"type\">Node</span>)</code></dt>\n\n<dd><p>Close the block for the given node.</p>\n</dd><dt id=\"MarkdownSerializerState.text\">\n  <code><strong><a href=\"#MarkdownSerializerState.text\">text</a></strong>(<a id=\"MarkdownSerializerState.text^text\" href=\"#MarkdownSerializerState.text^text\"><span class=param>text</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>, <a id=\"MarkdownSerializerState.text^escape\" href=\"#MarkdownSerializerState.text^escape\"><span class=param>escape</span></a>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\"><span class=\"prim\">boolean</span></a><span class=defaultvalue> = true</span>)</code></dt>\n\n<dd><p>Add the given text to the document. When escape is not <code>false</code>,\nit will be escaped.</p>\n</dd><dt id=\"MarkdownSerializerState.render\">\n  <code><strong><a href=\"#MarkdownSerializerState.render\">render</a></strong>(<a id=\"MarkdownSerializerState.render^node\" href=\"#MarkdownSerializerState.render^node\"><span class=param>node</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializerState.render^parent\" href=\"#MarkdownSerializerState.render^parent\"><span class=param>parent</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializerState.render^index\" href=\"#MarkdownSerializerState.render^index\"><span class=param>index</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><span class=\"prim\">number</span></a>)</code></dt>\n\n<dd><p>Render the given node as a block.</p>\n</dd><dt id=\"MarkdownSerializerState.renderContent\">\n  <code><strong><a href=\"#MarkdownSerializerState.renderContent\">renderContent</a></strong>(<a id=\"MarkdownSerializerState.renderContent^parent\" href=\"#MarkdownSerializerState.renderContent^parent\"><span class=param>parent</span></a>: <span class=\"type\">Node</span>)</code></dt>\n\n<dd><p>Render the contents of <code>parent</code> as block nodes.</p>\n</dd><dt id=\"MarkdownSerializerState.renderInline\">\n  <code><strong><a href=\"#MarkdownSerializerState.renderInline\">renderInline</a></strong>(<a id=\"MarkdownSerializerState.renderInline^parent\" href=\"#MarkdownSerializerState.renderInline^parent\"><span class=param>parent</span></a>: <span class=\"type\">Node</span>)</code></dt>\n\n<dd><p>Render the contents of <code>parent</code> as inline content.</p>\n</dd><dt id=\"MarkdownSerializerState.renderList\">\n  <code><strong><a href=\"#MarkdownSerializerState.renderList\">renderList</a></strong>(<a id=\"MarkdownSerializerState.renderList^node\" href=\"#MarkdownSerializerState.renderList^node\"><span class=param>node</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializerState.renderList^delim\" href=\"#MarkdownSerializerState.renderList^delim\"><span class=param>delim</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>, <a id=\"MarkdownSerializerState.renderList^firstDelim\" href=\"#MarkdownSerializerState.renderList^firstDelim\"><span class=param>firstDelim</span></a>: <span class=fn>fn</span>(<a id=\"MarkdownSerializerState.renderList^firstDelim^index\" href=\"#MarkdownSerializerState.renderList^firstDelim^index\"><span class=param>index</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><span class=\"prim\">number</span></a>) → <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>)</code></dt>\n\n<dd><p>Render a node's content as a list. <code>delim</code> should be the extra\nindentation added to all lines except the first in an item,\n<code>firstDelim</code> is a function going from an item index to a\ndelimiter for the first line of the item.</p>\n</dd><dt id=\"MarkdownSerializerState.esc\">\n  <code><strong><a href=\"#MarkdownSerializerState.esc\">esc</a></strong>(<a id=\"MarkdownSerializerState.esc^str\" href=\"#MarkdownSerializerState.esc^str\"><span class=param>str</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>, <a id=\"MarkdownSerializerState.esc^startOfLine\" href=\"#MarkdownSerializerState.esc^startOfLine\"><span class=param>startOfLine</span></a>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\"><span class=\"prim\">boolean</span></a><span class=defaultvalue> = false</span>) → <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a></code></dt>\n\n<dd><p>Escape the given string so that it can safely appear in Markdown\ncontent. If <code>startOfLine</code> is true, also escape characters that\nhave special meaning only at the start of the line.</p>\n</dd><dt id=\"MarkdownSerializerState.repeat\">\n  <code><strong><a href=\"#MarkdownSerializerState.repeat\">repeat</a></strong>(<a id=\"MarkdownSerializerState.repeat^str\" href=\"#MarkdownSerializerState.repeat^str\"><span class=param>str</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>, <a id=\"MarkdownSerializerState.repeat^n\" href=\"#MarkdownSerializerState.repeat^n\"><span class=param>n</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><span class=\"prim\">number</span></a>) → <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a></code></dt>\n\n<dd><p>Repeat the given string <code>n</code> times.</p>\n</dd><dt id=\"MarkdownSerializerState.markString\">\n  <code><strong><a href=\"#MarkdownSerializerState.markString\">markString</a></strong>(<a id=\"MarkdownSerializerState.markString^mark\" href=\"#MarkdownSerializerState.markString^mark\"><span class=param>mark</span></a>: <span class=\"type\">Mark</span>, <a id=\"MarkdownSerializerState.markString^open\" href=\"#MarkdownSerializerState.markString^open\"><span class=param>open</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\"><span class=\"prim\">boolean</span></a>, <a id=\"MarkdownSerializerState.markString^parent\" href=\"#MarkdownSerializerState.markString^parent\"><span class=param>parent</span></a>: <span class=\"type\">Node</span>, <a id=\"MarkdownSerializerState.markString^index\" href=\"#MarkdownSerializerState.markString^index\"><span class=param>index</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><span class=\"prim\">number</span></a>) → <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a></code></dt>\n\n<dd><p>Get the markdown string for a given opening or closing mark.</p>\n</dd><dt id=\"MarkdownSerializerState.getEnclosingWhitespace\">\n  <code><strong><a href=\"#MarkdownSerializerState.getEnclosingWhitespace\">getEnclosingWhitespace</a></strong>(<a id=\"MarkdownSerializerState.getEnclosingWhitespace^text\" href=\"#MarkdownSerializerState.getEnclosingWhitespace^text\"><span class=param>text</span></a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>) → {<span class=prop>leading</span>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>, <span class=prop>trailing</span>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><span class=\"prim\">string</span></a>}</code></dt>\n\n<dd><p>Get leading and trailing whitespace from a string. Values of\nleading or trailing property of the return object will be undefined\nif there is no match.</p>\n</dd></dl>\n\n</dd>\n<dt id=\"defaultMarkdownSerializer\">\n  <code><strong><a href=\"#defaultMarkdownSerializer\">defaultMarkdownSerializer</a></strong>: <a href=\"#MarkdownSerializer\"><span class=\"type\">MarkdownSerializer</span></a></code></dt>\n\n<dd><p>A serializer for the <a href=\"#schema\">basic schema</a>.</p>\n</dd>\n</dl>\n\n","publish_time":1742285745308,"_cnpm_publish_time":1742285745308,"dist-tags":{"beta":"1.9.0-beta.1","latest":"1.13.9"}}