diff --git a/src/markdown/emit/line-escaping.ts b/src/markdown/emit/line-escaping.ts index 000ef5a..34ddb70 100644 --- a/src/markdown/emit/line-escaping.ts +++ b/src/markdown/emit/line-escaping.ts @@ -231,7 +231,6 @@ function claimsCharacter( 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. function lastLinkClose(scan: string, escapings: readonly (InlineEscaping | undefined)[]): number { for (let cursor = scan.length - 1; cursor >= 0; cursor -= 1) { diff --git a/src/markdown/entity-references.test.ts b/src/markdown/entity-references.test.ts index 43507bf..6767876 100644 --- a/src/markdown/entity-references.test.ts +++ b/src/markdown/entity-references.test.ts @@ -1,8 +1,8 @@ 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 { dirname, join } from 'node:path' +import test from 'node:test' +import { fileURLToPath } from 'node:url' 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) for (const reference of references) { 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 ?? '') !== '') } })