devcenter-parser 1.4.4 → 1.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25340ea4ecb98e1623bfff8b17cee1cff582680e
4
- data.tar.gz: 832af492fd4729e9bfd61930cc880716cd9fb5d4
3
+ metadata.gz: 2feafea73af181b955b9cc60932afebf7f7dce5e
4
+ data.tar.gz: 031c16a36ca511a582936abfc1d85c71cc0d3f94
5
5
  SHA512:
6
- metadata.gz: 2d9732408264f55c6492f3fe8e9bbf06c3c289048fe4d2f5536319b925d96896a9f983648b3891ecb4c677b1e4aeb5ab841bc0f053c4ba760422ee946f4884f9
7
- data.tar.gz: a74f06a7634fb7dc93164de619642b77a086675e37e465ace4fd3ecc94993a23531c6fb6f54c68640dcb63bc2321664dc4613dea62b981560805f7ee21892ef7
6
+ metadata.gz: 3b207eabaae49710b78ae6fd99753245de12396af28f38158c8b5cda2b7cc819455edcd1f957d5de08172ad266e890549b9e020b0b4e0ab77cf2403b43432ff6
7
+ data.tar.gz: c4e88daa3d751a07fd30fb4603ab06e8f3a90902c202d6e6583a71fe9efaa4f287e2860c2ed5e747b3c3d6f7b59ec7515b40d9b3fc4c9e13394211bdf5516088
@@ -89,7 +89,7 @@ module DevcenterParser
89
89
  def self.convert_to_article_links_all_relative_links_with_missing_initial_slashes(doc)
90
90
  doc.css('a').each do |node|
91
91
  unless node['href'].nil? || node['href'] =~ /\Ahttp|\A\/|\Amailto\:|\A#/
92
- node['href'] = "/articles/#{node['href']}"
92
+ node['href'] = "/articles/#{node['href']}".gsub('/articles/articles/', '/articles/')
93
93
  end
94
94
  end
95
95
  end
@@ -1,3 +1,3 @@
1
1
  module DevcenterParser
2
- VERSION = '1.4.4'
2
+ VERSION = '1.4.5'
3
3
  end
@@ -330,6 +330,18 @@ more callout</p>
330
330
  end
331
331
  end
332
332
 
333
+ it 'converts "articles/foo relative links with missing initial slashes to article links' do
334
+ md = '[link](articles/foo)'
335
+ html = '<p><a href="/articles/foo">link</a></p>'
336
+ assert_maruku_result md, html
337
+ assert_github_result md, html
338
+
339
+ md = '[link](articles/foo#bar)'
340
+ html = '<p><a href="/articles/foo#bar">link</a></p>'
341
+ assert_maruku_result md, html
342
+ assert_github_result md, html
343
+ end
344
+
333
345
  it 'does not alter relative links with initial slashes nor absolute links nor anchor links to the same doc' do
334
346
  ['http://foo.com', 'https://foo.com', '/foo', '/foo/bar', '/foo#bar', '#foo', '/123', 'mailto:foo@foobar.com'].each do |href|
335
347
  md = "[link](#{href})"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devcenter-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heroku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-02 00:00:00.000000000 Z
11
+ date: 2014-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maruku