canvas_link_migrator 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: 6c077949f9cef706c71bff4537a9df6a3e53cb5306dadab87fb0281c79754a16
4
- data.tar.gz: d1f6d129570271a82b293f6422b00cb1b6533233713adaf1479fd5d7efda47cb
3
+ metadata.gz: 68ad9b1c1c452ba59ce56cae7ec072c38c185a4b5e4e3457082d8356dc95cd95
4
+ data.tar.gz: cc85f34cf8cb4abdb812d6582f213371afc6ccfd0a8ca6bb11f6152367d3d359
5
5
  SHA512:
6
- metadata.gz: b07d22a498fbb5188874aa67a6702be9ee349ed2be2efb5c4f42050d45b7914afb0edeae7d2f2127dae44531631f371cb1d8df62923133f8a88b96bcbe8f997f
7
- data.tar.gz: f1c6fa682fc28072571d3841d4418e14bc1240b453618ec19be98df2d09ab8a217c3638310bc0383e1a63f32ade812008f69a3198ad436167dd12f5ffc672673
6
+ metadata.gz: 8c8c85af3a7357591b9f07ddae0c98649c72880fc134c56cdafb20deb5083d2379020b7c459b191beeb4973f8fab878c831fb39b801b4249f4f8d1407eaec040
7
+ data.tar.gz: eded5e2885a8e3be4c22a2878c75e7ad889621f5a0f2bc4b57242656e5800aab0ad87d1ce5d18185b4080c1526f50382b81c49330feb74bf3d90925926cdbea3
@@ -129,7 +129,12 @@ module CanvasLinkMigrator
129
129
  url.gsub!("%24#{ref}%24", "$#{ref}$")
130
130
  end
131
131
 
132
- result = parse_url(url, node, attr)
132
+ begin
133
+ result = parse_url(url, node, attr)
134
+ rescue Addressable::URI::InvalidURIError
135
+ return
136
+ end
137
+
133
138
  if result[:resolved]
134
139
  # resolved, just replace and carry on
135
140
  new_url = result[:new_url] || url
@@ -42,5 +42,10 @@ describe CanvasLinkMigrator::LinkParser do
42
42
  expect(doc.at_css('a')['href']).to include("LINK.PLACEHOLDER")
43
43
  expect(doc.at_css('a').inner_html).not_to include("LINK.PLACEHOLDER")
44
44
  end
45
+
46
+ it "doesn't convert inner html of anchor tags if unnecessary" do
47
+ doc = Nokogiri::HTML5.fragment("<a href=\"https://what:10.1111/HFP.0b013e31828df26\">broken link</a>")
48
+ expect{ parser.convert_link(doc.at_css('a'), "href", "wiki_page", "migrationid", "") }.not_to raise_error
49
+ end
45
50
  end
46
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_link_migrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mysti Lilla
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-11-21 00:00:00.000000000 Z
14
+ date: 2024-01-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport