mumuki-html-runner 1.4.0 → 1.4.1

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: 69334d46a08d472eab0c7f3c876deddb6b112d76c396963788d7d2e667464742
4
- data.tar.gz: 676462124aca9486d5874f2100acd8eae6e7de3595622e79241aaa1d4370d52c
3
+ metadata.gz: 2c0771033573571fffde2c2d2da99b208dfacbb1e88ad309cf9876a305d9914a
4
+ data.tar.gz: 9083f8440c43f84e15f11b4f2b38592e3febde3717307da9c5f51a1d630d07c6
5
5
  SHA512:
6
- metadata.gz: d20a1a4a40b4688fec39cb16ee66273cca98cda64b62b056cee45deec23de6be3fbda41c9152272ab52a779550b7dc06bbc967bd2f01d6fe96d7d2c7087e9178
7
- data.tar.gz: 7a124a4980f436e105b4c88b75f5b3e9abc34a4da00ce24b7181baea2de47e726bbebabc22c3b4fa8b7a41cf3ddce907486c7c47788fba08a6ea7cd881454688
6
+ metadata.gz: 6cebf7fe755a947f300a8881ef2b6079bf89857ef2ad78b0885397623081ba3de3836ef8c3599bacca7e7f5f5ebdcb0839dbbe1f31528c3170a71a69586eeebf
7
+ data.tar.gz: 0209fb23e352863f542842972464852f761a04f2f3c88687595e81b15c6dfcc85981b1dfb5f7342dfd0a036694bf3e8685897134ecfd2d67a11e4bcf0f03800a
data/lib/metadata_hook.rb CHANGED
@@ -4,6 +4,7 @@ class HtmlMetadataHook < Mumukit::Hook
4
4
  name: 'html',
5
5
  icon: {type: 'devicon', name: 'html'},
6
6
  extension: 'html',
7
+ ace_mode: 'html',
7
8
  graphic: true
8
9
  },
9
10
  test_framework: {
data/lib/test_hook.rb CHANGED
@@ -1,5 +1,11 @@
1
1
  require 'mumukit/hook'
2
2
 
3
+ class String
4
+ def escape_html
5
+ ERB::Util.html_escape self
6
+ end
7
+ end
8
+
3
9
  class HtmlTestHook < Mumukit::Hook
4
10
  def compile(request)
5
11
  request
@@ -24,8 +30,8 @@ class HtmlTestHook < Mumukit::Hook
24
30
 
25
31
  def hexp_without_blanks(content)
26
32
  hexp ["\r", "\n", "\t"]
27
- .reduce(content.strip) { |c, it| c.gsub(it, ' ') }
28
- .squeeze(' ')
33
+ .reduce(content.strip) { |c, it| c.gsub(it, ' ') }
34
+ .squeeze(' ')
29
35
  end
30
36
 
31
37
  def hexp(squeezed_content)
@@ -55,13 +61,13 @@ html
55
61
 
56
62
  def page_favicon(dom)
57
63
  dom.xpath("//link[@rel='icon' and @href]").first
58
- .try { |tag| " data-favicon=\"#{tag['href']}\"" }
64
+ .try { |tag| " data-favicon=\"#{tag['href']}\"" }
59
65
  end
60
66
 
61
67
  def build_iframe(content)
62
68
  dom = hexp(content).to_dom
63
69
  <<html
64
- <div class="mu-browser"#{page_title dom}#{page_favicon dom} data-srcdoc="#{content.gsub('"', '&quot;')}">
70
+ <div class="mu-browser"#{page_title dom}#{page_favicon dom} data-srcdoc="#{content.escape_html}">
65
71
  </div>
66
72
  html
67
73
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module HtmlVersionHook
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
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.0
4
+ version: 1.4.1
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: 2017-12-28 00:00:00.000000000 Z
11
+ date: 2017-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit