mumuki-html-runner 1.13.0 → 1.14.0
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 +4 -4
- data/lib/test_dom_hook.rb +9 -1
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bef45a937249aac3b6f295ba3aa9c6ead134902e3dff6fd9f3ab09b33127f20
|
4
|
+
data.tar.gz: b3862c3908414db153d931e0806aab02d64defef6d19118a7c395cfb5677e825
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18a1ce2ca358b0ae6fffb4611012d4b94b69e80147b33f26f86af6cd298ce9938c6e34f7b8705fbc99d08722b7e84deed0b46df3d386e09a82d05c3c284f1555
|
7
|
+
data.tar.gz: '0833cd3ea0fca23e100be82e9b988a6db5a3b763c97fa261238f8f1beb6db71c746ce8a110a3a808f7a897b79f0909ae1b30fb00a7ea03c5304c44a301d9c90a'
|
data/lib/test_dom_hook.rb
CHANGED
@@ -88,11 +88,19 @@ html
|
|
88
88
|
def build_iframe(content)
|
89
89
|
dom = hexp(content).to_dom
|
90
90
|
<<html
|
91
|
-
<div class="mu-browser"#{page_title dom}#{page_favicon dom} data-srcdoc="#{content
|
91
|
+
<div class="mu-browser"#{page_title dom}#{page_favicon dom} data-srcdoc="#{transform_content(content)}">
|
92
92
|
</div>
|
93
93
|
html
|
94
94
|
end
|
95
95
|
|
96
|
+
def transform_content(content)
|
97
|
+
replace_anchors(content).escape_html
|
98
|
+
end
|
99
|
+
|
100
|
+
def replace_anchors(content)
|
101
|
+
content.gsub(/href="#(\w*)"/, 'href="about:srcdoc#\1"')
|
102
|
+
end
|
103
|
+
|
96
104
|
def compile_content(request)
|
97
105
|
request.extra.presence || request.content
|
98
106
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-html-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|