Escape the quoted attribute value, and pin the canonical form and the pipe cell's edges
CI / gate (push) Successful in 5s

This commit is contained in:
2026-08-26 23:27:29 +02:00
parent e4704990d7
commit ec0ae1f5db
13 changed files with 273 additions and 44 deletions
+4 -1
View File
@@ -9,6 +9,9 @@ export type SpelledPairs = { fault: AttributeFault; pairs?: undefined } | { faul
const bareToken = /^[A-Za-z0-9_-]+$/
// spec/flavour.md, Attributes.
const quotedEscapes = /[&<`|]/g
export function isBareToken(text: string): boolean {
return bareToken.test(text)
}
@@ -53,5 +56,5 @@ export function spellStringAttribute(text: string): string {
}
function quote(text: string): string {
return JSON.stringify(text)
return JSON.stringify(text).replace(quotedEscapes, (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`)
}