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 +4 -4
- data/.gitignore +1 -1
- data/lib/parliament/utils.rb +1 -1
- data/lib/parliament/utils/helpers/markdown_helper.rb +4 -2
- data/lib/parliament/utils/services/markdown_converter.rb +1 -4
- data/lib/parliament/utils/services/markdown_scrubber.rb +2 -1
- data/lib/parliament/utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5882bc351a1078a537fd3c4520c013dec4cac64b
|
4
|
+
data.tar.gz: fa074c337d4dbcb3a5189b2162386663892c0e3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52bfd09da89a9aaf9f2a8065f49ac64b409bbf8b530525dd6e4081e112496908f46adfa944e3cf303f2d0d1298e43475d4b8f631648471a89fe2ecccb7b88bdb
|
7
|
+
data.tar.gz: 7f9f2b866fb35691c7dfb2203c75fcba8acda74d08486d5e7452545d41998e812437e6b9fe4c395b080a2b9935bea2233bb4c8516092aaf8d5ae3103d8790e00
|
data/.gitignore
CHANGED
data/lib/parliament/utils.rb
CHANGED
@@ -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
|
-
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2018-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parliament-ruby
|