parliament-utils 0.8.5 → 0.8.6

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
  SHA1:
3
- metadata.gz: a93c4e7d7614401ed2be2cce1d75216064cb8a05
4
- data.tar.gz: 6d4483d22db5f03fdbf05d93e1f9d8aee233b45c
3
+ metadata.gz: 5882bc351a1078a537fd3c4520c013dec4cac64b
4
+ data.tar.gz: fa074c337d4dbcb3a5189b2162386663892c0e3e
5
5
  SHA512:
6
- metadata.gz: 5ee2a42fb6a4f7bc3c03ed3f2c8be735a82a280adbe1f7f2a3a77a9f1fa0efe4d164de7dfdb82933cbcf8afeed1ebc932040cb27611443feac6a734054e6936d
7
- data.tar.gz: bf8f28a614588820653311e0a56c0ad51a53acfc6f87001798e0f8497b6482bb89248f196e43ceacd5be3326c0fa8c3f24066212271f8ad480bea20ffc667f92
6
+ metadata.gz: 52bfd09da89a9aaf9f2a8065f49ac64b409bbf8b530525dd6e4081e112496908f46adfa944e3cf303f2d0d1298e43475d4b8f631648471a89fe2ecccb7b88bdb
7
+ data.tar.gz: 7f9f2b866fb35691c7dfb2203c75fcba8acda74d08486d5e7452545d41998e812437e6b9fe4c395b080a2b9935bea2233bb4c8516092aaf8d5ae3103d8790e00
data/.gitignore CHANGED
@@ -14,4 +14,4 @@
14
14
  # rspec failure tracking
15
15
  .rspec_status
16
16
 
17
- spec/dummy/log/*
17
+ spec/dummy/log/*.log
@@ -1,6 +1,6 @@
1
1
  require 'parliament/utils/version'
2
2
  require 'parliament/utils/helpers'
3
- require 'parliament/utils/services'
3
+ require 'parliament/utils/services' if defined?(Rails)
4
4
  require 'parliament/utils/config/initializers/bandiera'
5
5
  require 'parliament/utils/test_helpers'
6
6
  require 'parliament/utils/railtie' if defined?(Rails)
@@ -15,9 +15,11 @@ module Parliament
15
15
  parliament_renderer = Parliament::Utils::Services::ParliamentMarkdownRenderer
16
16
  parliament_scrubber = Parliament::Utils::Services::ParliamentMarkdownScrubber.new
17
17
 
18
- markdown = Redcarpet::Markdown.new(parliament_renderer, tables: true, autolink: true)
19
- html = markdown.render(ActionController::Base.helpers.sanitize(template, scrubber: parliament_scrubber))
18
+ markdown = Redcarpet::Markdown.new(parliament_renderer, tables: true, autolink: true, lax_spacing: true)
19
+
20
+ html = markdown.render(template)
20
21
  ActionController::Base.helpers.sanitize(html, scrubber: parliament_scrubber).html_safe
22
+ html.html_safe
21
23
  end
22
24
  end
23
25
  end
@@ -41,11 +41,8 @@ module Parliament
41
41
  url << 'audioOnly=False&autoStart=False&statsEnabled=False'
42
42
  end
43
43
 
44
- # Escape special characters in HTML
45
- video_url = CGI.escapeHTML(video_url)
46
-
47
44
  # Return the video player
48
- %(<div class="video-wrap"><iframe src="#{video_url}" name="UKPPlayer" title="UK Parliament Player" seamless="seamless" frameborder="0" allowfullscreen style="width: 100%; height: 100%"></iframe></div>)
45
+ %(<div class="video-wrap"><iframe src="#{video_url}" name="UKPPlayer" title="UK Parliament Player" seamless="seamless" frameborder="0" allowfullscreen style="width: 100%; height: 100%;"></iframe></div>)
49
46
  end
50
47
  end
51
48
  end
@@ -5,12 +5,13 @@ module Parliament
5
5
  # Overrides default sanitization allowing Parliament tags and/or attributes
6
6
  def initialize
7
7
  super
8
+
8
9
  self.tags = %w[p div h1 h2 h3 h4 h5 h6 span a ol li ul strong em i itag strike del u sup sub blockquote cite table thead tbody tfoot tr th td iframe image pre code dl dt dd hr br]
9
10
  self.attributes = %w[class href src name title allowfullscreen seamless frameborder style]
10
11
  end
11
12
 
12
13
  def skip_node?(node)
13
- node.text?
14
+ node.text? || node.name === 'iframe'
14
15
  end
15
16
  end
16
17
  end
@@ -1,5 +1,5 @@
1
1
  module Parliament
2
2
  module Utils
3
- VERSION = '0.8.5'.freeze
3
+ VERSION = '0.8.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parliament-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rebecca Appleyard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-25 00:00:00.000000000 Z
11
+ date: 2018-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parliament-ruby