Answer the stability pass: pin the deeper stack, the quoted newline and the closing fence
CI / gate (push) Successful in 5s
CI / gate (push) Successful in 5s
This commit is contained in:
@@ -120,6 +120,7 @@ test('names the inline directive left unclosed at the end of its line', () => {
|
||||
assert.equal(inline(':underline[:status[x'), 'an inline directive [content] is unclosed')
|
||||
assert.equal(inline(':mention[@A]{id=1'), 'the {attrs} closing brace is missing')
|
||||
assert.equal(inline(':mention{id=1'), 'the {attrs} closing brace is missing')
|
||||
assert.equal(inline(':text{text="a\nb"}'), 'the {attrs} quoted value is not a JSON string')
|
||||
})
|
||||
|
||||
test('refuses inline directives nested deeper than the parser carries', () => {
|
||||
|
||||
@@ -153,7 +153,7 @@ function readNestedDirective(text: string, index: number, depth: number): Read<D
|
||||
return { value: { attributes, content, length: cursor - index, name } }
|
||||
}
|
||||
|
||||
// Where the content's own closing bracket sits: a code span, an escape and a nested directive each bind before it.
|
||||
// A code span, an escape and a nested directive each bind before the content's own closing bracket.
|
||||
function readDirectiveContent(text: string, start: number, depth: number): Read<number> {
|
||||
let brackets = 0
|
||||
let cursor = start
|
||||
|
||||
@@ -102,6 +102,7 @@ test('holds a directive container open until the fence that closes it', () => {
|
||||
test('names the directive fence a container does not sit longer than', () => {
|
||||
assert.deepEqual(faults(':::panel info\n:::expand\nPart.\n:::\n'), ["a directive fence line is at least as long as the container's 3 colons"])
|
||||
assert.deepEqual(faults('::::panel info\n:::\n::::\n'), ['a closing fence is shorter than the 4 colons it would close'])
|
||||
assert.deepEqual(faults('::::panel info\n:::expand\nPart.\n:::::\n::::\n'), [])
|
||||
assert.deepEqual(faults(':::panel info\nPart.\n'), ['a container fenced with 3 colons is unclosed'])
|
||||
assert.deepEqual(faults('- :::panel info\n\nPart.\n'), ['a container fenced with 3 colons is unclosed'])
|
||||
assert.deepEqual(faults('Part.\n\n:::\n'), ['a closing fence closes no open container'])
|
||||
|
||||
@@ -130,7 +130,6 @@ test('claims a block-level colon run with no directive to parse it', () => {
|
||||
assert.equal(code(markdownToAdf(':::\n')), 'malformed-directive')
|
||||
assert.equal(code(markdownToAdf('::Panel\n')), 'malformed-directive')
|
||||
assert.equal(code(markdownToAdf('::panel {a=1 a=2}\n')), 'malformed-directive')
|
||||
assert.deepEqual(path(markdownToAdf('Part.\n:::x\n')), ['content', 1])
|
||||
assert.deepEqual(content(markdownToAdf(':10:30\n')), [paragraph(':10:30')])
|
||||
assert.deepEqual(content(markdownToAdf(':: two\n')), [paragraph(':: two')])
|
||||
})
|
||||
@@ -141,6 +140,8 @@ test('reads the three directive forms, and names the node none of them reads bac
|
||||
assert.equal(code(markdownToAdf('Part :mention[@A]{id=b1c2}.\n')), 'unknown-directive-name')
|
||||
assert.equal(content(markdownToAdf('::rule\n')), 'unknown-directive-name: the directive name rule reads back to no node')
|
||||
assert.deepEqual(path(markdownToAdf('Part.\n\n::rule\n')), ['content', 1])
|
||||
assert.equal(content(markdownToAdf('Part.\n:::x\n')), 'malformed-directive: a container fenced with 3 colons is unclosed')
|
||||
assert.deepEqual(path(markdownToAdf('Part.\n:::x\n')), ['content', 1])
|
||||
})
|
||||
|
||||
test('leaves the colon that opens no directive the text it is', () => {
|
||||
|
||||
Reference in New Issue
Block a user