3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 22:55:44 +01:00

Answer architecture round 1: 0 🔴, 7 🟡 (0 misread); test BlockText's measures and the batching against one run per pass, one withinLongest, marker facts beside their readers

This commit is contained in:
2026-10-29 13:55:50 +01:00
committed by Lillem4n
parent 10cb24e706
commit 28ae354315
15 changed files with 201 additions and 85 deletions
+6
View File
@@ -66,6 +66,7 @@ const emailNameSource = "[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]+"
const emailLabelSource = '[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?'
const emailAutolink = new RegExp(`<${emailNameSource}@${emailLabelSource}(?:\\.${emailLabelSource})*>`, 'y')
const orderedListOpener = /^(\d{1,9})([.)])(?:[ \t]|$)/
const ruleCharacters = /^[-*_ \t]*$/
const setextUnderline = /^(=+|-+)[ \t]*$/
const unicodeWhitespace = /[\t\n\f\r \p{Zs}]/u
@@ -203,6 +204,11 @@ export function holdsThematicBreak(tail: ThematicBreakTail | undefined, text: st
return text.length >= tail.shortest && text.length <= tail.longest && text.charAt(0) === tail.marker
}
// True of every line isThematicBreak takes, and kept for a prefixed line from its parts without reading it.
export function holdsOnlyRuleCharacters(text: string): boolean {
return ruleCharacters.test(text)
}
export function isUnicodeWhitespace(character: string): boolean {
return unicodeWhitespace.test(character)
}