canvas_link_migrator 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ad9b1c1c452ba59ce56cae7ec072c38c185a4b5e4e3457082d8356dc95cd95
|
4
|
+
data.tar.gz: cc85f34cf8cb4abdb812d6582f213371afc6ccfd0a8ca6bb11f6152367d3d359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.
|
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:
|
14
|
+
date: 2024-01-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|