rich_text_renderer 0.1.0 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +1 -1
- data/lib/rich_text_renderer/block_renderers/asset_block_renderer.rb +27 -0
- data/lib/rich_text_renderer/block_renderers/asset_hyperlink_renderer.rb +64 -0
- data/lib/rich_text_renderer/block_renderers/blockquote_renderer.rb +1 -1
- data/lib/rich_text_renderer/block_renderers/entry_block_renderer.rb +1 -1
- data/lib/rich_text_renderer/block_renderers.rb +2 -0
- data/lib/rich_text_renderer/renderer.rb +2 -0
- data/lib/rich_text_renderer/text_renderers/text_renderer.rb +2 -0
- data/lib/rich_text_renderer/version.rb +1 -1
- metadata +9 -165
- data/.gitignore +0 -7
- data/.rspec +0 -1
- data/.rubocop.yml +0 -27
- data/.rubocop_todo.yml +0 -35
- data/.travis.yml +0 -13
- data/.yardopts +0 -4
- data/Gemfile +0 -3
- data/Gemfile.lock +0 -110
- data/Guardfile +0 -24
- data/Rakefile +0 -33
- data/coverage/.last_run.json +0 -5
- data/coverage/.resultset.json +0 -1372
- data/coverage/.resultset.json.lock +0 -0
- data/coverage/assets/0.10.2/application.css +0 -799
- data/coverage/assets/0.10.2/application.js +0 -1707
- data/coverage/assets/0.10.2/colorbox/border.png +0 -0
- data/coverage/assets/0.10.2/colorbox/controls.png +0 -0
- data/coverage/assets/0.10.2/colorbox/loading.gif +0 -0
- data/coverage/assets/0.10.2/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.10.2/favicon_green.png +0 -0
- data/coverage/assets/0.10.2/favicon_red.png +0 -0
- data/coverage/assets/0.10.2/favicon_yellow.png +0 -0
- data/coverage/assets/0.10.2/loading.gif +0 -0
- data/coverage/assets/0.10.2/magnify.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/index.html +0 -9146
- data/doc/RichTextRenderer/BaseBlockRenderer.html +0 -242
- data/doc/RichTextRenderer/BaseInlineRenderer.html +0 -242
- data/doc/RichTextRenderer/BaseNodeRenderer.html +0 -300
- data/doc/RichTextRenderer/BlockQuoteRenderer.html +0 -169
- data/doc/RichTextRenderer/BoldRenderer.html +0 -169
- data/doc/RichTextRenderer/CodeRenderer.html +0 -169
- data/doc/RichTextRenderer/DocumentRenderer.html +0 -242
- data/doc/RichTextRenderer/EntryBlockRenderer.html +0 -239
- data/doc/RichTextRenderer/HeadingFiveRenderer.html +0 -169
- data/doc/RichTextRenderer/HeadingFourRenderer.html +0 -169
- data/doc/RichTextRenderer/HeadingOneRenderer.html +0 -169
- data/doc/RichTextRenderer/HeadingSixRenderer.html +0 -169
- data/doc/RichTextRenderer/HeadingThreeRenderer.html +0 -169
- data/doc/RichTextRenderer/HeadingTwoRenderer.html +0 -169
- data/doc/RichTextRenderer/HrRenderer.html +0 -238
- data/doc/RichTextRenderer/HyperlinkRenderer.html +0 -246
- data/doc/RichTextRenderer/ItalicRenderer.html +0 -169
- data/doc/RichTextRenderer/ListItemRenderer.html +0 -169
- data/doc/RichTextRenderer/NullRenderer.html +0 -238
- data/doc/RichTextRenderer/OrderedListRenderer.html +0 -169
- data/doc/RichTextRenderer/ParagraphRenderer.html +0 -169
- data/doc/RichTextRenderer/Renderer.html +0 -349
- data/doc/RichTextRenderer/TextRenderer.html +0 -254
- data/doc/RichTextRenderer/UnderlineRenderer.html +0 -169
- data/doc/RichTextRenderer/UnorderedListRenderer.html +0 -169
- data/doc/RichTextRenderer.html +0 -155
- data/doc/StructuredTextRenderer/BaseBlockRenderer.html +0 -242
- data/doc/StructuredTextRenderer/BaseInlineRenderer.html +0 -242
- data/doc/StructuredTextRenderer/BaseNodeRenderer.html +0 -300
- data/doc/StructuredTextRenderer/BoldRenderer.html +0 -169
- data/doc/StructuredTextRenderer/CodeRenderer.html +0 -169
- data/doc/StructuredTextRenderer/DocumentRenderer.html +0 -242
- data/doc/StructuredTextRenderer/EntryBlockRenderer.html +0 -239
- data/doc/StructuredTextRenderer/HeadingFiveRenderer.html +0 -169
- data/doc/StructuredTextRenderer/HeadingFourRenderer.html +0 -169
- data/doc/StructuredTextRenderer/HeadingOneRenderer.html +0 -169
- data/doc/StructuredTextRenderer/HeadingSixRenderer.html +0 -169
- data/doc/StructuredTextRenderer/HeadingThreeRenderer.html +0 -169
- data/doc/StructuredTextRenderer/HeadingTwoRenderer.html +0 -169
- data/doc/StructuredTextRenderer/HrRenderer.html +0 -238
- data/doc/StructuredTextRenderer/HyperlinkRenderer.html +0 -246
- data/doc/StructuredTextRenderer/ItalicRenderer.html +0 -169
- data/doc/StructuredTextRenderer/ListItemRenderer.html +0 -169
- data/doc/StructuredTextRenderer/NullRenderer.html +0 -238
- data/doc/StructuredTextRenderer/OrderedListRenderer.html +0 -169
- data/doc/StructuredTextRenderer/ParagraphRenderer.html +0 -169
- data/doc/StructuredTextRenderer/QuoteRenderer.html +0 -169
- data/doc/StructuredTextRenderer/Renderer.html +0 -349
- data/doc/StructuredTextRenderer/TextRenderer.html +0 -254
- data/doc/StructuredTextRenderer/UnderlineRenderer.html +0 -169
- data/doc/StructuredTextRenderer/UnorderedListRenderer.html +0 -169
- data/doc/StructuredTextRenderer.html +0 -155
- data/doc/_index.html +0 -387
- data/doc/class_list.html +0 -51
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -58
- data/doc/css/style.css +0 -496
- data/doc/file.CHANGELOG.html +0 -91
- data/doc/file.LICENSE.html +0 -70
- data/doc/file.README.html +0 -170
- data/doc/file_list.html +0 -66
- data/doc/frames.html +0 -17
- data/doc/index.html +0 -170
- data/doc/js/app.js +0 -292
- data/doc/js/full_list.js +0 -216
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -147
- data/doc/top-level-namespace.html +0 -110
- data/rich_text_renderer.gemspec +0 -30
- data/spec/lib/rich_text_renderer/block_renderers/base_block_renderer_spec.rb +0 -26
- data/spec/lib/rich_text_renderer/block_renderers/blockquote_renderer_spec.rb +0 -25
- data/spec/lib/rich_text_renderer/block_renderers/entry_block_renderer_spec.rb +0 -15
- data/spec/lib/rich_text_renderer/block_renderers/heading_five_renderer_spec.rb +0 -24
- data/spec/lib/rich_text_renderer/block_renderers/heading_four_renderer_spec.rb +0 -24
- data/spec/lib/rich_text_renderer/block_renderers/heading_one_renderer_spec.rb +0 -24
- data/spec/lib/rich_text_renderer/block_renderers/heading_six_renderer_spec.rb +0 -24
- data/spec/lib/rich_text_renderer/block_renderers/heading_three_renderer_spec.rb +0 -24
- data/spec/lib/rich_text_renderer/block_renderers/heading_two_renderer_spec.rb +0 -24
- data/spec/lib/rich_text_renderer/block_renderers/hr_renderer_spec.rb +0 -13
- data/spec/lib/rich_text_renderer/block_renderers/hyperlink_renderer_spec.rb +0 -24
- data/spec/lib/rich_text_renderer/block_renderers/list_item_renderer_spec.rb +0 -24
- data/spec/lib/rich_text_renderer/block_renderers/ordered_list_renderer_spec.rb +0 -56
- data/spec/lib/rich_text_renderer/block_renderers/paragraph_renderer_spec.rb +0 -30
- data/spec/lib/rich_text_renderer/block_renderers/unordered_list_renderer_spec.rb +0 -56
- data/spec/lib/rich_text_renderer/document_renderers/document_renderer_spec.rb +0 -42
- data/spec/lib/rich_text_renderer/null_renderer_spec.rb +0 -19
- data/spec/lib/rich_text_renderer/renderer_spec.rb +0 -308
- data/spec/lib/rich_text_renderer/text_renderers/base_inline_renderer_spec.rb +0 -11
- data/spec/lib/rich_text_renderer/text_renderers/bold_renderer_spec.rb +0 -11
- data/spec/lib/rich_text_renderer/text_renderers/code_renderer_spec.rb +0 -11
- data/spec/lib/rich_text_renderer/text_renderers/italic_renderer_spec.rb +0 -11
- data/spec/lib/rich_text_renderer/text_renderers/text_renderer_spec.rb +0 -53
- data/spec/lib/rich_text_renderer/text_renderers/underline_renderer_spec.rb +0 -11
- data/spec/spec_helper.rb +0 -82
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed6e8984770f2a314c34f268a09de046902ce01696925e34c6ba37ccd1740ec1
|
4
|
+
data.tar.gz: 24a13f3656d06ddb921b4baa896db2f8db58d749a7f5d33deacbac33ad0db60a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 391168bf54f2b75feee27eb595b5db31be5de407f01a8d186653f3cf14b1f004780b237e03c1b5074ae426ef745ee0339214636fa2027e0d773364fc42fd294c
|
7
|
+
data.tar.gz: 13eca7f66f894bc91301472a20b54a3bfa069d20d227ae4eb47c1714b9d58dc9b5800af8298a50f74193324013af8bb0cd1e0eaf9cb380a2a839c425253e2fc0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,23 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## v0.2.3
|
6
|
+
* Removed unwanted files from gem release package.
|
7
|
+
|
8
|
+
## v0.2.2
|
9
|
+
### Fixed
|
10
|
+
* Fixed mispelt blockquote tag. [#9](https://github.com/contentful/rich-text-renderer.rb/pull/9)
|
11
|
+
* Removed the possibility of XSS via text in nodes. [#10](https://github.com/contentful/rich-text-renderer.rb/pull/10)
|
12
|
+
|
13
|
+
## v0.2.1
|
14
|
+
### Fixed
|
15
|
+
* Default `EntryBlockRenderer` now properly stringifies `data.target` instead of just data.
|
16
|
+
|
17
|
+
## v0.2.0
|
18
|
+
|
19
|
+
### Added
|
20
|
+
* Add Asset support
|
21
|
+
|
5
22
|
## v0.1.0 (`rich_text_renderer`)
|
6
23
|
|
7
24
|
As `RichText` moves from `alpha` to `beta`, we're treating this as a feature release.
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ An example entry renderer, assuming our entry has 2 fields called `name` and `de
|
|
52
52
|
```ruby
|
53
53
|
class MyEntryBlockRenderer < RichTextRenderer::BaseNodeRenderer
|
54
54
|
def render(node)
|
55
|
-
entry = node['data']
|
55
|
+
entry = node['data']['target']
|
56
56
|
|
57
57
|
"<div class='my-entry'><h3>#{entry.name}</h3><p><small>#{entry.description}</p></small></div>"
|
58
58
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative './asset_hyperlink_renderer'
|
2
|
+
|
3
|
+
module RichTextRenderer
|
4
|
+
# Asset block renderer
|
5
|
+
class AssetBlockRenderer < AssetHyperlinkRenderer
|
6
|
+
# IMG HTML Tag
|
7
|
+
IMAGE_HTML = ->(url, text) { "<img src=\"#{url}\" alt=\"#{text}\" />" }
|
8
|
+
|
9
|
+
protected
|
10
|
+
|
11
|
+
def render_asset(asset, node = nil)
|
12
|
+
if asset.file.respond_to?(:content_type) && asset.file.content_type.include?('image')
|
13
|
+
return render!(IMAGE_HTML, asset.url, asset.title)
|
14
|
+
end
|
15
|
+
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
19
|
+
def render_hash(asset, node = nil)
|
20
|
+
if asset.fetch('fields', {}).fetch('file', {}).fetch('contentType', '').include?('image')
|
21
|
+
return render!(IMAGE_HTML, asset['fields']['file']['url'], asset['fields']['title'])
|
22
|
+
end
|
23
|
+
|
24
|
+
super
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require_relative './base_block_renderer'
|
2
|
+
|
3
|
+
module RichTextRenderer
|
4
|
+
# Asset hyperlink renderer
|
5
|
+
class AssetHyperlinkRenderer < BaseBlockRenderer
|
6
|
+
# Anchor HTML Tag
|
7
|
+
ANCHOR_HTML = ->(url, text) { "<a href=\"#{url}\">#{text}</a>" }
|
8
|
+
|
9
|
+
# Renders asset nodes
|
10
|
+
def render(node)
|
11
|
+
asset = nil
|
12
|
+
begin
|
13
|
+
asset = node['data']['target']
|
14
|
+
rescue
|
15
|
+
fail "Node target is not an asset - Node: #{node}"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Check by class name instead of instance type to
|
19
|
+
# avoid dependending on the Contentful SDK.
|
20
|
+
return render_asset(asset, node) if asset.class.ancestors.map(&:to_s).any? { |name| name.include?('Asset') }
|
21
|
+
|
22
|
+
if asset.is_a?(::Hash)
|
23
|
+
unless asset.key?('fields') && asset['fields'].key?('file')
|
24
|
+
fail "Node target is not an asset - Node: #{node}"
|
25
|
+
end
|
26
|
+
|
27
|
+
return render_hash(asset, node)
|
28
|
+
end
|
29
|
+
|
30
|
+
fail "Node target is not an asset - Node: #{node}"
|
31
|
+
end
|
32
|
+
|
33
|
+
protected
|
34
|
+
|
35
|
+
def render_asset(asset, node = nil)
|
36
|
+
render!(
|
37
|
+
ANCHOR_HTML,
|
38
|
+
asset.url,
|
39
|
+
renders_node?(node) ? node : asset.title,
|
40
|
+
renders_node?(node)
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def render_hash(asset, node = nil)
|
45
|
+
render!(
|
46
|
+
ANCHOR_HTML,
|
47
|
+
asset['fields']['file']['url'],
|
48
|
+
renders_node?(node) ? node : asset['fields']['title'],
|
49
|
+
renders_node?(node)
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
def renders_node?(node)
|
54
|
+
!(node.nil? || node.empty?) && (
|
55
|
+
node.is_a?(::Hash) ? renders_node?(node['content']) : true
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
59
|
+
def render!(markup, url, text, formatted = false)
|
60
|
+
text = render_content(text) if formatted
|
61
|
+
markup[url, text]
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -5,6 +5,8 @@ require_relative './block_renderers/hyperlink_renderer'
|
|
5
5
|
require_relative './block_renderers/blockquote_renderer'
|
6
6
|
|
7
7
|
require_relative './block_renderers/entry_block_renderer'
|
8
|
+
require_relative './block_renderers/asset_block_renderer'
|
9
|
+
require_relative './block_renderers/asset_hyperlink_renderer'
|
8
10
|
|
9
11
|
require_relative './block_renderers/heading_one_renderer'
|
10
12
|
require_relative './block_renderers/heading_two_renderer'
|
@@ -25,6 +25,8 @@ module RichTextRenderer
|
|
25
25
|
'ordered-list' => OrderedListRenderer,
|
26
26
|
'unordered-list' => UnorderedListRenderer,
|
27
27
|
'embedded-entry-block' => EntryBlockRenderer,
|
28
|
+
'embedded-asset-block' => AssetBlockRenderer,
|
29
|
+
'asset-hyperlink' => AssetHyperlinkRenderer,
|
28
30
|
'hr' => HrRenderer,
|
29
31
|
'text' => TextRenderer,
|
30
32
|
'bold' => BoldRenderer,
|
@@ -7,6 +7,8 @@ module RichTextRenderer
|
|
7
7
|
def render(node)
|
8
8
|
node = Marshal.load(Marshal.dump(node)) # Clone the node
|
9
9
|
|
10
|
+
node['value'] = CGI.escapeHTML(node['value'])
|
11
|
+
|
10
12
|
node.fetch('marks', []).each do |mark|
|
11
13
|
renderer = mappings[mark['type']]
|
12
14
|
return mappings[nil].new(mappings).render(mark) if renderer.nil? && mappings.key?(nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rich_text_renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contentful GmbH (David Litvak Bruno)
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -170,118 +170,14 @@ executables: []
|
|
170
170
|
extensions: []
|
171
171
|
extra_rdoc_files: []
|
172
172
|
files:
|
173
|
-
- ".gitignore"
|
174
|
-
- ".rspec"
|
175
|
-
- ".rubocop.yml"
|
176
|
-
- ".rubocop_todo.yml"
|
177
|
-
- ".travis.yml"
|
178
|
-
- ".yardopts"
|
179
173
|
- CHANGELOG.md
|
180
|
-
- Gemfile
|
181
|
-
- Gemfile.lock
|
182
|
-
- Guardfile
|
183
174
|
- LICENSE.txt
|
184
175
|
- README.md
|
185
|
-
- Rakefile
|
186
|
-
- coverage/.last_run.json
|
187
|
-
- coverage/.resultset.json
|
188
|
-
- coverage/.resultset.json.lock
|
189
|
-
- coverage/assets/0.10.2/application.css
|
190
|
-
- coverage/assets/0.10.2/application.js
|
191
|
-
- coverage/assets/0.10.2/colorbox/border.png
|
192
|
-
- coverage/assets/0.10.2/colorbox/controls.png
|
193
|
-
- coverage/assets/0.10.2/colorbox/loading.gif
|
194
|
-
- coverage/assets/0.10.2/colorbox/loading_background.png
|
195
|
-
- coverage/assets/0.10.2/favicon_green.png
|
196
|
-
- coverage/assets/0.10.2/favicon_red.png
|
197
|
-
- coverage/assets/0.10.2/favicon_yellow.png
|
198
|
-
- coverage/assets/0.10.2/loading.gif
|
199
|
-
- coverage/assets/0.10.2/magnify.png
|
200
|
-
- coverage/assets/0.10.2/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
|
201
|
-
- coverage/assets/0.10.2/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
|
202
|
-
- coverage/assets/0.10.2/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
|
203
|
-
- coverage/assets/0.10.2/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
|
204
|
-
- coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_dadada_1x400.png
|
205
|
-
- coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
|
206
|
-
- coverage/assets/0.10.2/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
|
207
|
-
- coverage/assets/0.10.2/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
208
|
-
- coverage/assets/0.10.2/smoothness/images/ui-icons_222222_256x240.png
|
209
|
-
- coverage/assets/0.10.2/smoothness/images/ui-icons_2e83ff_256x240.png
|
210
|
-
- coverage/assets/0.10.2/smoothness/images/ui-icons_454545_256x240.png
|
211
|
-
- coverage/assets/0.10.2/smoothness/images/ui-icons_888888_256x240.png
|
212
|
-
- coverage/assets/0.10.2/smoothness/images/ui-icons_cd0a0a_256x240.png
|
213
|
-
- coverage/index.html
|
214
|
-
- doc/RichTextRenderer.html
|
215
|
-
- doc/RichTextRenderer/BaseBlockRenderer.html
|
216
|
-
- doc/RichTextRenderer/BaseInlineRenderer.html
|
217
|
-
- doc/RichTextRenderer/BaseNodeRenderer.html
|
218
|
-
- doc/RichTextRenderer/BlockQuoteRenderer.html
|
219
|
-
- doc/RichTextRenderer/BoldRenderer.html
|
220
|
-
- doc/RichTextRenderer/CodeRenderer.html
|
221
|
-
- doc/RichTextRenderer/DocumentRenderer.html
|
222
|
-
- doc/RichTextRenderer/EntryBlockRenderer.html
|
223
|
-
- doc/RichTextRenderer/HeadingFiveRenderer.html
|
224
|
-
- doc/RichTextRenderer/HeadingFourRenderer.html
|
225
|
-
- doc/RichTextRenderer/HeadingOneRenderer.html
|
226
|
-
- doc/RichTextRenderer/HeadingSixRenderer.html
|
227
|
-
- doc/RichTextRenderer/HeadingThreeRenderer.html
|
228
|
-
- doc/RichTextRenderer/HeadingTwoRenderer.html
|
229
|
-
- doc/RichTextRenderer/HrRenderer.html
|
230
|
-
- doc/RichTextRenderer/HyperlinkRenderer.html
|
231
|
-
- doc/RichTextRenderer/ItalicRenderer.html
|
232
|
-
- doc/RichTextRenderer/ListItemRenderer.html
|
233
|
-
- doc/RichTextRenderer/NullRenderer.html
|
234
|
-
- doc/RichTextRenderer/OrderedListRenderer.html
|
235
|
-
- doc/RichTextRenderer/ParagraphRenderer.html
|
236
|
-
- doc/RichTextRenderer/Renderer.html
|
237
|
-
- doc/RichTextRenderer/TextRenderer.html
|
238
|
-
- doc/RichTextRenderer/UnderlineRenderer.html
|
239
|
-
- doc/RichTextRenderer/UnorderedListRenderer.html
|
240
|
-
- doc/StructuredTextRenderer.html
|
241
|
-
- doc/StructuredTextRenderer/BaseBlockRenderer.html
|
242
|
-
- doc/StructuredTextRenderer/BaseInlineRenderer.html
|
243
|
-
- doc/StructuredTextRenderer/BaseNodeRenderer.html
|
244
|
-
- doc/StructuredTextRenderer/BoldRenderer.html
|
245
|
-
- doc/StructuredTextRenderer/CodeRenderer.html
|
246
|
-
- doc/StructuredTextRenderer/DocumentRenderer.html
|
247
|
-
- doc/StructuredTextRenderer/EntryBlockRenderer.html
|
248
|
-
- doc/StructuredTextRenderer/HeadingFiveRenderer.html
|
249
|
-
- doc/StructuredTextRenderer/HeadingFourRenderer.html
|
250
|
-
- doc/StructuredTextRenderer/HeadingOneRenderer.html
|
251
|
-
- doc/StructuredTextRenderer/HeadingSixRenderer.html
|
252
|
-
- doc/StructuredTextRenderer/HeadingThreeRenderer.html
|
253
|
-
- doc/StructuredTextRenderer/HeadingTwoRenderer.html
|
254
|
-
- doc/StructuredTextRenderer/HrRenderer.html
|
255
|
-
- doc/StructuredTextRenderer/HyperlinkRenderer.html
|
256
|
-
- doc/StructuredTextRenderer/ItalicRenderer.html
|
257
|
-
- doc/StructuredTextRenderer/ListItemRenderer.html
|
258
|
-
- doc/StructuredTextRenderer/NullRenderer.html
|
259
|
-
- doc/StructuredTextRenderer/OrderedListRenderer.html
|
260
|
-
- doc/StructuredTextRenderer/ParagraphRenderer.html
|
261
|
-
- doc/StructuredTextRenderer/QuoteRenderer.html
|
262
|
-
- doc/StructuredTextRenderer/Renderer.html
|
263
|
-
- doc/StructuredTextRenderer/TextRenderer.html
|
264
|
-
- doc/StructuredTextRenderer/UnderlineRenderer.html
|
265
|
-
- doc/StructuredTextRenderer/UnorderedListRenderer.html
|
266
|
-
- doc/_index.html
|
267
|
-
- doc/class_list.html
|
268
|
-
- doc/css/common.css
|
269
|
-
- doc/css/full_list.css
|
270
|
-
- doc/css/style.css
|
271
|
-
- doc/file.CHANGELOG.html
|
272
|
-
- doc/file.LICENSE.html
|
273
|
-
- doc/file.README.html
|
274
|
-
- doc/file_list.html
|
275
|
-
- doc/frames.html
|
276
|
-
- doc/index.html
|
277
|
-
- doc/js/app.js
|
278
|
-
- doc/js/full_list.js
|
279
|
-
- doc/js/jquery.js
|
280
|
-
- doc/method_list.html
|
281
|
-
- doc/top-level-namespace.html
|
282
176
|
- lib/rich_text_renderer.rb
|
283
177
|
- lib/rich_text_renderer/base_node_renderer.rb
|
284
178
|
- lib/rich_text_renderer/block_renderers.rb
|
179
|
+
- lib/rich_text_renderer/block_renderers/asset_block_renderer.rb
|
180
|
+
- lib/rich_text_renderer/block_renderers/asset_hyperlink_renderer.rb
|
285
181
|
- lib/rich_text_renderer/block_renderers/base_block_renderer.rb
|
286
182
|
- lib/rich_text_renderer/block_renderers/blockquote_renderer.rb
|
287
183
|
- lib/rich_text_renderer/block_renderers/entry_block_renderer.rb
|
@@ -309,37 +205,11 @@ files:
|
|
309
205
|
- lib/rich_text_renderer/text_renderers/text_renderer.rb
|
310
206
|
- lib/rich_text_renderer/text_renderers/underline_renderer.rb
|
311
207
|
- lib/rich_text_renderer/version.rb
|
312
|
-
- rich_text_renderer.gemspec
|
313
|
-
- spec/lib/rich_text_renderer/block_renderers/base_block_renderer_spec.rb
|
314
|
-
- spec/lib/rich_text_renderer/block_renderers/blockquote_renderer_spec.rb
|
315
|
-
- spec/lib/rich_text_renderer/block_renderers/entry_block_renderer_spec.rb
|
316
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_five_renderer_spec.rb
|
317
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_four_renderer_spec.rb
|
318
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_one_renderer_spec.rb
|
319
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_six_renderer_spec.rb
|
320
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_three_renderer_spec.rb
|
321
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_two_renderer_spec.rb
|
322
|
-
- spec/lib/rich_text_renderer/block_renderers/hr_renderer_spec.rb
|
323
|
-
- spec/lib/rich_text_renderer/block_renderers/hyperlink_renderer_spec.rb
|
324
|
-
- spec/lib/rich_text_renderer/block_renderers/list_item_renderer_spec.rb
|
325
|
-
- spec/lib/rich_text_renderer/block_renderers/ordered_list_renderer_spec.rb
|
326
|
-
- spec/lib/rich_text_renderer/block_renderers/paragraph_renderer_spec.rb
|
327
|
-
- spec/lib/rich_text_renderer/block_renderers/unordered_list_renderer_spec.rb
|
328
|
-
- spec/lib/rich_text_renderer/document_renderers/document_renderer_spec.rb
|
329
|
-
- spec/lib/rich_text_renderer/null_renderer_spec.rb
|
330
|
-
- spec/lib/rich_text_renderer/renderer_spec.rb
|
331
|
-
- spec/lib/rich_text_renderer/text_renderers/base_inline_renderer_spec.rb
|
332
|
-
- spec/lib/rich_text_renderer/text_renderers/bold_renderer_spec.rb
|
333
|
-
- spec/lib/rich_text_renderer/text_renderers/code_renderer_spec.rb
|
334
|
-
- spec/lib/rich_text_renderer/text_renderers/italic_renderer_spec.rb
|
335
|
-
- spec/lib/rich_text_renderer/text_renderers/text_renderer_spec.rb
|
336
|
-
- spec/lib/rich_text_renderer/text_renderers/underline_renderer_spec.rb
|
337
|
-
- spec/spec_helper.rb
|
338
208
|
homepage: https://github.com/contentful/rich-text-renderer.rb
|
339
209
|
licenses:
|
340
210
|
- MIT
|
341
211
|
metadata: {}
|
342
|
-
post_install_message:
|
212
|
+
post_install_message:
|
343
213
|
rdoc_options: []
|
344
214
|
require_paths:
|
345
215
|
- lib
|
@@ -354,34 +224,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
354
224
|
- !ruby/object:Gem::Version
|
355
225
|
version: '0'
|
356
226
|
requirements: []
|
357
|
-
|
358
|
-
|
359
|
-
signing_key:
|
227
|
+
rubygems_version: 3.0.3
|
228
|
+
signing_key:
|
360
229
|
specification_version: 4
|
361
230
|
summary: Rich Text Renderer for the Contentful RichText field type
|
362
|
-
test_files:
|
363
|
-
- spec/lib/rich_text_renderer/block_renderers/base_block_renderer_spec.rb
|
364
|
-
- spec/lib/rich_text_renderer/block_renderers/blockquote_renderer_spec.rb
|
365
|
-
- spec/lib/rich_text_renderer/block_renderers/entry_block_renderer_spec.rb
|
366
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_five_renderer_spec.rb
|
367
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_four_renderer_spec.rb
|
368
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_one_renderer_spec.rb
|
369
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_six_renderer_spec.rb
|
370
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_three_renderer_spec.rb
|
371
|
-
- spec/lib/rich_text_renderer/block_renderers/heading_two_renderer_spec.rb
|
372
|
-
- spec/lib/rich_text_renderer/block_renderers/hr_renderer_spec.rb
|
373
|
-
- spec/lib/rich_text_renderer/block_renderers/hyperlink_renderer_spec.rb
|
374
|
-
- spec/lib/rich_text_renderer/block_renderers/list_item_renderer_spec.rb
|
375
|
-
- spec/lib/rich_text_renderer/block_renderers/ordered_list_renderer_spec.rb
|
376
|
-
- spec/lib/rich_text_renderer/block_renderers/paragraph_renderer_spec.rb
|
377
|
-
- spec/lib/rich_text_renderer/block_renderers/unordered_list_renderer_spec.rb
|
378
|
-
- spec/lib/rich_text_renderer/document_renderers/document_renderer_spec.rb
|
379
|
-
- spec/lib/rich_text_renderer/null_renderer_spec.rb
|
380
|
-
- spec/lib/rich_text_renderer/renderer_spec.rb
|
381
|
-
- spec/lib/rich_text_renderer/text_renderers/base_inline_renderer_spec.rb
|
382
|
-
- spec/lib/rich_text_renderer/text_renderers/bold_renderer_spec.rb
|
383
|
-
- spec/lib/rich_text_renderer/text_renderers/code_renderer_spec.rb
|
384
|
-
- spec/lib/rich_text_renderer/text_renderers/italic_renderer_spec.rb
|
385
|
-
- spec/lib/rich_text_renderer/text_renderers/text_renderer_spec.rb
|
386
|
-
- spec/lib/rich_text_renderer/text_renderers/underline_renderer_spec.rb
|
387
|
-
- spec/spec_helper.rb
|
231
|
+
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color --format documentation
|
data/.rubocop.yml
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
2
|
-
|
3
|
-
Encoding:
|
4
|
-
Enabled: false
|
5
|
-
|
6
|
-
Metrics/ClassLength:
|
7
|
-
CountComments: false
|
8
|
-
|
9
|
-
Metrics/MethodLength:
|
10
|
-
CountComments: false
|
11
|
-
|
12
|
-
AllCops:
|
13
|
-
Exclude:
|
14
|
-
- structured_text_renderer.gemspec
|
15
|
-
- spec/**/*
|
16
|
-
- Guardfile
|
17
|
-
- Gemfile
|
18
|
-
- Rakefile
|
19
|
-
|
20
|
-
Metrics/ClassLength:
|
21
|
-
Max: 250
|
22
|
-
|
23
|
-
Style/MutableConstant:
|
24
|
-
Enabled: false
|
25
|
-
|
26
|
-
Style/SignalException:
|
27
|
-
EnforcedStyle: 'semantic'
|
data/.rubocop_todo.yml
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2016-02-02 13:30:13 -0300 using RuboCop version 0.36.0.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 6
|
10
|
-
Metrics/AbcSize:
|
11
|
-
Max: 38
|
12
|
-
|
13
|
-
# Offense count: 5
|
14
|
-
Metrics/CyclomaticComplexity:
|
15
|
-
Max: 8
|
16
|
-
|
17
|
-
# Offense count: 1
|
18
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
19
|
-
# URISchemes: http, https
|
20
|
-
Metrics/LineLength:
|
21
|
-
Max: 142
|
22
|
-
|
23
|
-
# Offense count: 12
|
24
|
-
# Configuration parameters: CountComments.
|
25
|
-
Metrics/MethodLength:
|
26
|
-
Max: 27
|
27
|
-
|
28
|
-
# Offense count: 2
|
29
|
-
# Configuration parameters: CountComments.
|
30
|
-
Metrics/ModuleLength:
|
31
|
-
Max: 499
|
32
|
-
|
33
|
-
# Offense count: 4
|
34
|
-
Metrics/PerceivedComplexity:
|
35
|
-
Max: 8
|
data/.travis.yml
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.4.0
|
4
|
-
- 2.3.1
|
5
|
-
- 2.2.1
|
6
|
-
notifications:
|
7
|
-
slack:
|
8
|
-
secure: Zr3mKCiTb0vaTD4MPtTG8BbyYyErFuoxioM25QyrqePKVkDFeZC1MtGmg5klQQrJiWTKZPa/zB8NAHYkoUxg9I+z15JK0hYfz9KRubEpCrXCaqTC9Vzq88kJ3LN8YsTyBF66izaBH2KLsOfaJRxwplFzZqgpg4GG2DUBPtrGtes=
|
9
|
-
before_install: gem install bundler -v 1.10.6
|
10
|
-
script: bundle exec rake rspec_rubocop
|
11
|
-
matrix:
|
12
|
-
allow_failures:
|
13
|
-
- rvm: jruby
|
data/.yardopts
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
rich_text_renderer (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
ast (2.4.0)
|
10
|
-
coderay (1.1.2)
|
11
|
-
diff-lcs (1.3)
|
12
|
-
docile (1.3.1)
|
13
|
-
ffi (1.9.25)
|
14
|
-
formatador (0.2.5)
|
15
|
-
guard (2.14.2)
|
16
|
-
formatador (>= 0.2.4)
|
17
|
-
listen (>= 2.7, < 4.0)
|
18
|
-
lumberjack (>= 1.0.12, < 2.0)
|
19
|
-
nenv (~> 0.1)
|
20
|
-
notiffany (~> 0.0)
|
21
|
-
pry (>= 0.9.12)
|
22
|
-
shellany (~> 0.0)
|
23
|
-
thor (>= 0.18.1)
|
24
|
-
guard-compat (1.2.1)
|
25
|
-
guard-rspec (4.7.3)
|
26
|
-
guard (~> 2.1)
|
27
|
-
guard-compat (~> 1.1)
|
28
|
-
rspec (>= 2.99.0, < 4.0)
|
29
|
-
guard-rubocop (1.3.0)
|
30
|
-
guard (~> 2.0)
|
31
|
-
rubocop (~> 0.20)
|
32
|
-
guard-yard (2.2.1)
|
33
|
-
guard (>= 1.1.0)
|
34
|
-
yard (>= 0.7.0)
|
35
|
-
json (2.1.0)
|
36
|
-
listen (3.1.5)
|
37
|
-
rb-fsevent (~> 0.9, >= 0.9.4)
|
38
|
-
rb-inotify (~> 0.9, >= 0.9.7)
|
39
|
-
ruby_dep (~> 1.2)
|
40
|
-
lumberjack (1.0.13)
|
41
|
-
method_source (0.9.0)
|
42
|
-
nenv (0.3.0)
|
43
|
-
notiffany (0.1.1)
|
44
|
-
nenv (~> 0.1)
|
45
|
-
shellany (~> 0.0)
|
46
|
-
parallel (1.12.1)
|
47
|
-
parser (2.5.1.2)
|
48
|
-
ast (~> 2.4.0)
|
49
|
-
powerpack (0.1.2)
|
50
|
-
pry (0.11.3)
|
51
|
-
coderay (~> 1.1.0)
|
52
|
-
method_source (~> 0.9.0)
|
53
|
-
rainbow (2.2.2)
|
54
|
-
rake
|
55
|
-
rake (10.5.0)
|
56
|
-
rb-fsevent (0.10.3)
|
57
|
-
rb-inotify (0.9.10)
|
58
|
-
ffi (>= 0.5.0, < 2)
|
59
|
-
rspec (3.8.0)
|
60
|
-
rspec-core (~> 3.8.0)
|
61
|
-
rspec-expectations (~> 3.8.0)
|
62
|
-
rspec-mocks (~> 3.8.0)
|
63
|
-
rspec-core (3.8.0)
|
64
|
-
rspec-support (~> 3.8.0)
|
65
|
-
rspec-expectations (3.8.1)
|
66
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
-
rspec-support (~> 3.8.0)
|
68
|
-
rspec-mocks (3.8.0)
|
69
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
-
rspec-support (~> 3.8.0)
|
71
|
-
rspec-support (3.8.0)
|
72
|
-
rubocop (0.49.1)
|
73
|
-
parallel (~> 1.10)
|
74
|
-
parser (>= 2.3.3.1, < 3.0)
|
75
|
-
powerpack (~> 0.1)
|
76
|
-
rainbow (>= 1.99.1, < 3.0)
|
77
|
-
ruby-progressbar (~> 1.7)
|
78
|
-
unicode-display_width (~> 1.0, >= 1.0.1)
|
79
|
-
ruby-progressbar (1.10.0)
|
80
|
-
ruby_dep (1.5.0)
|
81
|
-
rubygems-tasks (0.2.4)
|
82
|
-
shellany (0.0.1)
|
83
|
-
simplecov (0.16.1)
|
84
|
-
docile (~> 1.1)
|
85
|
-
json (>= 1.8, < 3)
|
86
|
-
simplecov-html (~> 0.10.0)
|
87
|
-
simplecov-html (0.10.2)
|
88
|
-
thor (0.20.0)
|
89
|
-
unicode-display_width (1.4.0)
|
90
|
-
yard (0.9.16)
|
91
|
-
|
92
|
-
PLATFORMS
|
93
|
-
ruby
|
94
|
-
|
95
|
-
DEPENDENCIES
|
96
|
-
bundler (~> 1.5)
|
97
|
-
guard
|
98
|
-
guard-rspec
|
99
|
-
guard-rubocop
|
100
|
-
guard-yard
|
101
|
-
rake (< 11.0)
|
102
|
-
rich_text_renderer!
|
103
|
-
rspec (~> 3)
|
104
|
-
rubocop (~> 0.49.1)
|
105
|
-
rubygems-tasks (~> 0.2)
|
106
|
-
simplecov
|
107
|
-
yard
|
108
|
-
|
109
|
-
BUNDLED WITH
|
110
|
-
1.16.3
|
data/Guardfile
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
group :green_red_refactor, halt_on_fail: true do
|
2
|
-
guard :rspec, cmd: "bundle exec rspec" do
|
3
|
-
require "guard/rspec/dsl"
|
4
|
-
dsl = Guard::RSpec::Dsl.new(self)
|
5
|
-
|
6
|
-
# Feel free to open issues for suggestions and improvements
|
7
|
-
|
8
|
-
# RSpec files
|
9
|
-
rspec = dsl.rspec
|
10
|
-
watch(rspec.spec_helper) { rspec.spec_dir }
|
11
|
-
watch(rspec.spec_support) { rspec.spec_dir }
|
12
|
-
watch(rspec.spec_files)
|
13
|
-
|
14
|
-
# Ruby files
|
15
|
-
ruby = dsl.ruby
|
16
|
-
dsl.watch_spec_files_for(ruby.lib_files)
|
17
|
-
end
|
18
|
-
|
19
|
-
guard :yard, cmd: "yard doc" do
|
20
|
-
end
|
21
|
-
|
22
|
-
guard :rubocop, cmd: "rubocop" do
|
23
|
-
end
|
24
|
-
end
|