Answer the stability nits: the guard proves the value, not just the row
CI / gate (push) Successful in 5s

This commit is contained in:
2026-08-30 23:32:10 +02:00
parent 5c83679dc8
commit 10c66cc386
2 changed files with 4 additions and 5 deletions
-1
View File
@@ -231,7 +231,6 @@ function claimsCharacter(
return false return false
} }
// The last `]` link text could close on, so a `[` ahead of it opens one and a `[` past it cannot.
// A `]` the emitter spelled sits inside a construct that binds before link text does. // A `]` the emitter spelled sits inside a construct that binds before link text does.
function lastLinkClose(scan: string, escapings: readonly (InlineEscaping | undefined)[]): number { function lastLinkClose(scan: string, escapings: readonly (InlineEscaping | undefined)[]): number {
for (let cursor = scan.length - 1; cursor >= 0; cursor -= 1) { for (let cursor = scan.length - 1; cursor >= 0; cursor -= 1) {
+4 -4
View File
@@ -1,8 +1,8 @@
import assert from 'node:assert/strict' import assert from 'node:assert/strict'
import test from 'node:test'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { readFileSync } from 'node:fs' import { readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import test from 'node:test'
import { fileURLToPath } from 'node:url'
import { readEntityReference } from './entity-references.ts' import { readEntityReference } from './entity-references.ts'
@@ -16,6 +16,6 @@ test('every packed reference parts into one name and one value the table decodes
assert.equal(references.length, 2125) assert.equal(references.length, 2125)
for (const reference of references) { for (const reference of references) {
assert.match(reference, /^[A-Za-z][A-Za-z0-9]*~[^ ~]+$/) assert.match(reference, /^[A-Za-z][A-Za-z0-9]*~[^ ~]+$/)
assert.ok(readEntityReference(`&${reference.slice(0, reference.indexOf('~'))};`, 0) !== undefined) assert.ok((readEntityReference(`&${reference.slice(0, reference.indexOf('~'))};`, 0)?.text ?? '') !== '')
} }
}) })