canvas_link_migrator 1.0.12 → 1.0.13
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b5936b2c0b84390589696838b2f7409d71467a11b20f81c63176e8e99a54caa
|
4
|
+
data.tar.gz: 49c4a0df338db02c8b658c49249f2fb8c3f9a75d60790f6fd72a405242682fca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3c0f69c22fd75d7f783fa017993c7803f7504aa2e4b353917b33ec730a2cf0577e3f8941b58472a6ab694ab92bd667be12c5d65300119d7febea6cca0b9d45f
|
7
|
+
data.tar.gz: 3e6158123ea5ad27bd55033865474133d9bdc7e663006c05eb3d8efb76bf7fe49a6041e0b37d19d1d0ca606aba4bbb329caa9cd4b92e13db8b97fc65dace5d24
|
@@ -232,7 +232,7 @@ module CanvasLinkMigrator
|
|
232
232
|
elsif url =~ %r{\$IMS(?:-|_)CC(?:-|_)FILEBASE\$/(.*)}
|
233
233
|
rel_path = URI::DEFAULT_PARSER.unescape($1)
|
234
234
|
if (attr == "href" && node["class"]&.include?("instructure_inline_media_comment")) ||
|
235
|
-
(attr == "src" && ["iframe", "source"].include?(node.name))
|
235
|
+
(attr == "src" && ["iframe", "source"].include?(node.name) && (node["data-media-id"] || node["data-media-type"]))
|
236
236
|
unresolved(:media_object, rel_path: rel_path)
|
237
237
|
else
|
238
238
|
unresolved(:file, rel_path: rel_path)
|
@@ -400,5 +400,16 @@ describe CanvasLinkMigrator::ImportedHtmlConverter do
|
|
400
400
|
test_string = '<p><a href="#anchor_ref">ref</a></p>'
|
401
401
|
expect(@converter.convert_exported_html(test_string)).to eq([test_string, nil])
|
402
402
|
end
|
403
|
+
|
404
|
+
it "converts iframe srcs that point to non-media files" do
|
405
|
+
test_string = <<~HTML
|
406
|
+
<p><iframe style="width: 100%; height: 100vh; border: none;" src="$IMS-CC-FILEBASE$/subfolder/test.png?canvas_download=1"></iframe></p>
|
407
|
+
HTML
|
408
|
+
converted_string = <<~HTML
|
409
|
+
<p><iframe style="width: 100%; height: 100vh; border: none;" src="/courses/2/files/7/download?verifier=u7"></iframe></p>
|
410
|
+
HTML
|
411
|
+
html = @converter.convert_exported_html(test_string)
|
412
|
+
expect(html[0]).to eq converted_string
|
413
|
+
end
|
403
414
|
end
|
404
415
|
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.13
|
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: 2024-
|
14
|
+
date: 2024-07-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|