documentation-editor 0.0.6 → 0.0.7
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7bdacfe2b5f51241f500516411b6ed2a626515ac
|
|
4
|
+
data.tar.gz: 68abadcc62db314a2fffd764daf60a9c5b7afd73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 13624d0ab386204817cd0f08e0c03c4f9149c622c9cec9f9b955c6ecb711ccba9d30dc039b7ec60e96414c2052621404dc1babb3ea0083f300de03f471df2f28
|
|
7
|
+
data.tar.gz: d39661d49cc3a71cdce9dcf1eefea9414552401d02b1d2d3bd166cb12380140add9fe4f65a84593135ccd4c20159e38d571219c45835c607684d28402a5169b2
|
|
@@ -41,7 +41,7 @@ module DocumentationEditor
|
|
|
41
41
|
doc = Kramdown::Document.new(content, options.merge(input: 'BlockKramdown'))
|
|
42
42
|
|
|
43
43
|
# apply the /if filtering
|
|
44
|
-
doc.root.children = apply_filtering(doc.root.children, options)
|
|
44
|
+
doc.root.children = apply_filtering(doc.root.children, options, [])
|
|
45
45
|
|
|
46
46
|
# wrap in sections
|
|
47
47
|
if !options[:no_wrap] && DocumentationEditor::Config.wrap_h1_with_sections
|
|
@@ -65,8 +65,7 @@ module DocumentationEditor
|
|
|
65
65
|
doc
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
def apply_filtering(children, options)
|
|
69
|
-
conditions_stack = []
|
|
68
|
+
def apply_filtering(children, options, conditions_stack)
|
|
70
69
|
children.map do |child|
|
|
71
70
|
if child.type == :comment
|
|
72
71
|
if child.options[:start] == true
|
|
@@ -82,8 +81,9 @@ module DocumentationEditor
|
|
|
82
81
|
conditions_stack.last == false ? nil : child
|
|
83
82
|
end
|
|
84
83
|
else
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
res = conditions_stack.last == false ? nil : child
|
|
85
|
+
child.children = apply_filtering(child.children, options, conditions_stack)
|
|
86
|
+
res
|
|
87
87
|
end
|
|
88
88
|
end.compact
|
|
89
89
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: documentation-editor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Algolia Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-08-
|
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|