summaryrefslogtreecommitdiffstats
path: root/test/links.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/links.js')
-rw-r--r--test/links.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/links.js b/test/links.js
index 4dad4d4..2c68a23 100644
--- a/test/links.js
+++ b/test/links.js
@@ -13,6 +13,13 @@ describe('Links', function () {
assert(!links.isExternal("/folder/test.md"));
});
+ it('should correctly test anchor links', function() {
+ assert(links.isAnchor("#test"));
+ assert(links.isAnchor(" #test"));
+ assert(!links.isAnchor("https://google.fr#test"));
+ assert(!links.isAnchor("test.md#test"));
+ });
+
describe('toAbsolute', function() {
it('should correctly transform as absolute', function() {
assert.equal(links.toAbsolute("http://google.fr"), "http://google.fr");