Skip to content

Commit e4273f7

Browse files
committed
Add test for colon after text directive
Related to: remarkjs/remark#651.
1 parent a5326b5 commit e4273f7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,5 +840,32 @@ test('mdast -> markdown', function (t) {
840840
'should escape a `:` at a break when followed by two colons'
841841
)
842842

843+
t.deepEqual(
844+
toMarkdown(
845+
{
846+
type: 'paragraph',
847+
children: [{type: 'text', value: ':::\na'}]
848+
},
849+
{extensions: [directive.toMarkdown]}
850+
),
851+
'\\:::\na\n',
852+
'should escape a `:` at a break when followed by two colons'
853+
)
854+
855+
t.deepEqual(
856+
toMarkdown(
857+
{
858+
type: 'paragraph',
859+
children: [
860+
{type: 'textDirective', name: 'red'},
861+
{type: 'text', value: ':'}
862+
]
863+
},
864+
{extensions: [directive.toMarkdown]}
865+
),
866+
':red:\n',
867+
'should escape a `:` after a text directive'
868+
)
869+
843870
t.end()
844871
})

0 commit comments

Comments
 (0)