test/devcenter-parser_test.rb in devcenter-parser-1.4.4 vs test/devcenter-parser_test.rb in devcenter-parser-1.4.5

- old
+ new

@@ -328,9 +328,21 @@ assert_maruku_result md, html assert_github_result md, html end end + it 'converts "articles/foo relative links with missing initial slashes to article links' do + md = '[link](articles/foo)' + html = '<p><a href="/articles/foo">link</a></p>' + assert_maruku_result md, html + assert_github_result md, html + + md = '[link](articles/foo#bar)' + html = '<p><a href="/articles/foo#bar">link</a></p>' + assert_maruku_result md, html + assert_github_result md, html + end + it 'does not alter relative links with initial slashes nor absolute links nor anchor links to the same doc' do ['http://foo.com', 'https://foo.com', '/foo', '/foo/bar', '/foo#bar', '#foo', '/123', 'mailto:foo@foobar.com'].each do |href| md = "[link](#{href})" html = "<p><a href=\"#{href}\">link</a></p>" assert_maruku_result md, html