devcenter-parser 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ require 'sanitize'
6
6
 
7
7
  module DevcenterParser
8
8
 
9
- VERSION = '1.2.0'
9
+ VERSION = '1.2.1'
10
10
 
11
11
  AVAILABLE_FLAVOURS = [:github, :maruku]
12
12
 
@@ -116,7 +116,7 @@ module DevcenterParser
116
116
 
117
117
  def self.convert_to_article_links_all_relative_links_with_missing_initial_slashes(doc)
118
118
  doc.css('a').each do |node|
119
- unless node['href'] =~ /\Ahttp|\A\/|mailto\:/
119
+ unless node['href'] =~ /\Ahttp|\A\/|\Amailto\:|\A#/
120
120
  node['href'] = "/articles/#{node['href']}"
121
121
  end
122
122
  end
@@ -193,8 +193,8 @@ And that's it.
193
193
  end
194
194
  end
195
195
 
196
- it 'does not alter relative links with initial slashes nor absolute links' do
197
- ['http://foo.com', 'https://foo.com', '/foo', '/foo/bar', '/foo#bar', '/123', 'mailto:foo@foobar.com'].each do |href|
196
+ it 'does not alter relative links with initial slashes nor absolute links nor anchor links to the same doc' do
197
+ ['http://foo.com', 'https://foo.com', '/foo', '/foo/bar', '/foo#bar', '#foo', '/123', 'mailto:foo@foobar.com'].each do |href|
198
198
  md = "[link](#{href})"
199
199
  html = "<p><a href=\"#{href}\">link</a></p>"
200
200
  assert_maruku_result md, html
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devcenter-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: