Pin the deactivation where an image close folds the evidence away
This commit is contained in:
@@ -39,7 +39,7 @@ type Run = { canClose: boolean; canOpen: boolean; character: string; index: numb
|
||||
// `container` is `undefined` inside a directive's content slot, the emitter's `bracketed`.
|
||||
type Scan = {
|
||||
container: LineContainer | undefined
|
||||
// Pieces below this have been walked for openers to deactivate: one left active reaches closeLink, whose image and carry guards refuse a span going literal anyway.
|
||||
// Pieces below this have been walked for openers to deactivate: an image close folds the link-marked piece into alt text, leaving this the only record that the brackets around it are doomed.
|
||||
deactivatedBefore: number
|
||||
definitions: LinkDefinitions
|
||||
openingSpellableLink: boolean
|
||||
|
||||
@@ -849,7 +849,8 @@ test('keeps the carry and the image the brackets a nested link leaves literal ho
|
||||
assert.deepEqual(content(markdownToAdf(`[[<http://x/>](/c)${carried}](/w)\n`)), [
|
||||
{ content: [text('[['), marked('http://x/', link('http://x/')), text('](/c)'), { type: 'placeholder' }, text('](/w)')], type: 'paragraph' },
|
||||
])
|
||||
assert.deepEqual(content(markdownToAdf(' ](/i)[[<http://x/>](/c)](/w)](/v)\n')), [image('/v', 'a b [x[http://x/](/c)](/w)')])
|
||||
// The image close folds the link-marked piece into alt text, so only the deactivation still knows the enclosing bracket is doomed.
|
||||
assert.deepEqual(content(markdownToAdf(' ](/i)[](/y)](/w)](/v)\n')), [image('/v', 'a b [[http://x/](/c)](/w)')])
|
||||
})
|
||||
|
||||
test('reads the reference links a definition resolves, and leaves the rest literal', () => {
|
||||
|
||||
Reference in New Issue
Block a user