markitdown 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -98,7 +98,7 @@ module Markitdown
98
98
  results << pre
99
99
  when "a"
100
100
  results << " ["
101
- after = ["](#{node.attributes["href"].value}) "]
101
+ after = ["](#{node.attributes["href"].value if node.attributes["href"]}) "]
102
102
  strip_content = true
103
103
  when "img"
104
104
  results << " !["
@@ -1,3 +1,3 @@
1
1
  module Markitdown
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -156,13 +156,21 @@ describe Markitdown do
156
156
  end
157
157
 
158
158
  context "When parsing a link" do
159
- let(:html) { "<a href='http://www.google.com'>this is a link</strong>" }
159
+ let(:html) { "<a href='http://www.google.com'>this is a link</a>" }
160
160
 
161
161
  it "should return valid markdown" do
162
162
  Markitdown.from_html(html).should == " [this is a link](http://www.google.com) "
163
163
  end
164
164
  end
165
165
 
166
+ context "When parsing a link without an href" do
167
+ let(:html) { "<a>this is a link</a>" }
168
+
169
+ it "should return valid markdown" do
170
+ Markitdown.from_html(html).should == " [this is a link]() "
171
+ end
172
+ end
173
+
166
174
  context "When parsing an image" do
167
175
  let(:html) { "<img src='https://www.google.com/images/srpr/logo3w.png' alt='Google Logo'>" }
168
176
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markitdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-27 00:00:00.000000000 Z
12
+ date: 2012-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  segments:
98
98
  - 0
99
- hash: 1279176731261814561
99
+ hash: -705547097769987992
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  none: false
102
102
  requirements:
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  segments:
107
107
  - 0
108
- hash: 1279176731261814561
108
+ hash: -705547097769987992
109
109
  requirements: []
110
110
  rubyforge_project:
111
111
  rubygems_version: 1.8.24