diff --git a/AGENTS.md b/AGENTS.md index 21ce233..c2fdf95 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -54,9 +54,9 @@ Round-trip equality is a property tested over a corpus, not a claim made in pros `dependencies` is empty. A runtime dependency enters only through a decision entry here stating why ~20 lines of own code cannot do the job, who maintains it, and what auditing it costs. So the CommonMark and HTML parsers are written in this repo. A table a standard fixes is data rather than -a dependency: HTML5's 2125 semicolon-terminated character references ship packed in -`markdown/entity-references.ts`, so entity decoding is complete without one. `devDependencies`: -few, each earning its keep; they never reach a consumer. +a dependency: HTML5's 2125 semicolon-terminated character references ship packed in their own +module, so entity decoding is complete without one. `devDependencies`: few, each earning its keep; +they never reach a consumer. ## 6. The package contract diff --git a/corpus/round-trip/commonmark-subset/text-escaping.json b/corpus/round-trip/commonmark-subset/text-escaping.json index 5481877..9350b74 100644 --- a/corpus/round-trip/commonmark-subset/text-escaping.json +++ b/corpus/round-trip/commonmark-subset/text-escaping.json @@ -44,6 +44,24 @@ } ], "type": "paragraph" + }, + { + "content": [ + { + "text": "
]*>/ }, { name: htmlConstructNames.processingInstruction, pattern: /^<\?[\s\S]*?\?>/ }, ] +// CommonMark 0.31.2, HTML blocks: the tag names start condition 6 lists. +const blockTagNames = + 'address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul' +const completeTag = new RegExp(`^${htmlTagSource}[ \\t]*$`) +const htmlBlockConditions: HtmlBlockCondition[] = [ + { closer: /<\/(?:pre|script|style|textarea)>/i, construct: undefined, interrupts: true, start: /^<(?:pre|script|style|textarea)(?:[ \t>]|$)/i }, + { closer: /-->/, construct: htmlConstructNames.comment, interrupts: true, start: /^/, construct: htmlConstructNames.comment, interrupts: true, start: /^