Skip to content

Commit

Permalink
Add test for associating w/ references, escapes, phrasing
Browse files Browse the repository at this point in the history
This adds a test case to make sure link references can be associated
with definition if their labels contain character references and
-escapes, and other phrasing constructs.

Related to mdast-util-from-markdown#24.
Related to remarkjs/remark#850.
  • Loading branch information
wooorm committed Sep 19, 2021
1 parent bad551e commit 5be7549
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/io/text/link-reference.js
Expand Up @@ -332,6 +332,35 @@ test('link (reference)', function (t) {
'should not support mismatched character references in fulls'
)

t.equal(
micromark(
`[*f*][]
[;][]
[\\;][]
[;][]
[*f*;][]
[*f*\\;][]
[*f*;][]
[*f*]: alpha
[;]: bravo
[\\;]: charlie
[;]: delta
[*f*;]: echo
[*f*\\;]: foxtrot
[*f*;]: golf`
),
`<p><a href="alpha"><em>f</em></a>
<a href="bravo">;</a>
<a href="charlie">;</a>
<a href="delta">;</a>
<a href="echo"><em>f</em>;</a>
<a href="foxtrot"><em>f</em>;</a>
<a href="golf"><em>f</em>;</a></p>
`,
'should properly handle labels w/ character references and -escapes, and phrasing'
)

// 999 `x` characters.
const max = Array.from({length: 1000}).join('x')

Expand Down

0 comments on commit 5be7549

Please sign in to comment.