Literal brackets put nothing inside a mark, so the nested-link check runs ahead of both guards
This commit is contained in:
@@ -416,6 +416,7 @@ test('names the mark spelling no opaque carry sits inside', () => {
|
||||
assert.equal(content(markdownToAdf(`**${carried}**\n`)), named)
|
||||
assert.equal(content(markdownToAdf(`~~a ${carried}~~\n`)), named)
|
||||
assert.equal(content(markdownToAdf(`[a ${carried} b](https://example.com/x)\n`)), named)
|
||||
assert.equal(content(markdownToAdf(`[*<http://x/>${carried}*](/w)\n`)), named)
|
||||
assert.equal(content(markdownToAdf(`!adf:underline[${carried}]\n`)), named)
|
||||
assert.equal(content(markdownToAdf(`!adf:textColor[a ${carried}]{color="#ae2e24"}\n`)), named)
|
||||
assert.equal(content(markdownToAdf(`\n`)), named)
|
||||
@@ -842,8 +843,11 @@ test('leaves the brackets of a link whose text already holds one the text they a
|
||||
})
|
||||
|
||||
test('keeps the carry and the image the brackets a nested link leaves literal hold', () => {
|
||||
assert.deepEqual(content(markdownToAdf('[[<http://x/>](/c)!adf:carry{json="{\\"type\\":\\"blockCard\\"}"}](/w)\n')), [
|
||||
{ content: [text('[['), marked('http://x/', link('http://x/')), text('](/c)'), { type: 'blockCard' }, text('](/w)')], type: 'paragraph' },
|
||||
assert.deepEqual(content(markdownToAdf(`[<http://x/>${carried}](/w)\n`)), [
|
||||
{ content: [text('['), marked('http://x/', link('http://x/')), { type: 'placeholder' }, text('](/w)')], type: 'paragraph' },
|
||||
])
|
||||
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)')])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user