5b1: guarantee the parse direction's position in the type, and name it one level deeper
CI / gate (push) Successful in 9s

This commit is contained in:
2026-09-03 17:09:14 +02:00
parent 51009ac3f6
commit 8a88c50630
11 changed files with 58 additions and 33 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
import { readEntityReference } from './entity-references.ts'
import { readEntityReference, replacementCharacter } from './entity-references.ts'
export type LinePosition = 'first' | 'later'
@@ -27,6 +27,7 @@ const bracketedAutolink = new RegExp(`<(?:${autolinkSource})>`, 'y')
const controlCharacter = new RegExp(`[${controlCharacterRange}]`)
const htmlTag = new RegExp(htmlTagSource, 'y')
const nullCharacter = new RegExp(nullCharacterSource)
const nullCharacters = new RegExp(nullCharacterSource, 'g')
const tagName = new RegExp(`^</?(${tagNameSource})[\\s\\S]*$`)
// The opener's own match ends with the terminator where the construct is complete on its own (`<!-->`).
const inlineHtmlConstructs = [
@@ -137,6 +138,10 @@ export function holdsNullCharacter(text: string): boolean {
return nullCharacter.test(text)
}
export function replaceNullCharacters(text: string): string {
return text.replaceAll(nullCharacters, replacementCharacter)
}
function htmlTagName(text: string): string {
return text.replace(tagName, '<$1>')
}