diff options
Diffstat (limited to 'lib/output/modifiers/__tests__/resolveLinks.js')
-rw-r--r-- | lib/output/modifiers/__tests__/resolveLinks.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/output/modifiers/__tests__/resolveLinks.js b/lib/output/modifiers/__tests__/resolveLinks.js index e42b619..c57346a 100644 --- a/lib/output/modifiers/__tests__/resolveLinks.js +++ b/lib/output/modifiers/__tests__/resolveLinks.js @@ -40,9 +40,8 @@ describe('resolveLinks', function() { }); describe('Anchor', function() { - var TEST = '<p>This is a <a href="test/cool.md#an-anchor"></a></p>'; - it('should prevent anchors in resolution', function() { + var TEST = '<p>This is a <a href="test/cool.md#an-anchor"></a></p>'; var $ = cheerio.load(TEST); return resolveLinks('hello.md', resolveFileCustom, $) @@ -51,6 +50,17 @@ describe('resolveLinks', function() { expect(link.attr('href')).toBe('test/cool.html#an-anchor'); }); }); + + it('should ignore pure anchor links', function() { + var TEST = '<p>This is a <a href="#an-anchor"></a></p>'; + var $ = cheerio.load(TEST); + + return resolveLinks('hello.md', resolveFileCustom, $) + .then(function() { + var link = $('a'); + expect(link.attr('href')).toBe('#an-anchor'); + }); + }); }); describe('Custom Resolver', function() { |