documentation-editor 0.0.6 → 0.0.7

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: 5df9d3922194dac8d1fdbaf0a0738327fe831d51
4
- data.tar.gz: c758321378718f58217459519b5d3196ab33e8ab
3
+ metadata.gz: 7bdacfe2b5f51241f500516411b6ed2a626515ac
4
+ data.tar.gz: 68abadcc62db314a2fffd764daf60a9c5b7afd73
5
5
  SHA512:
6
- metadata.gz: bc9698672c529f0746547505ae63288d210d3b7019327a1d8feff002a10556a5f48bda7c89dd07e71bc3cd71916d61a457cb4cfda2e0d82eeb2280a39328bca2
7
- data.tar.gz: a9d32039be21acf75c8fea4ed3d8f52b86748994cda163e8fddd896684c07b5be0116ec70c90d829498c787cbe0d06aa5655054e464e6133e84538e6167c1e7f
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
- child.children = apply_filtering(child.children, options)
86
- conditions_stack.last == false ? nil : child
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
@@ -1,3 +1,3 @@
1
1
  module DocumentationEditor
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  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.6
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-03 00:00:00.000000000 Z
11
+ date: 2015-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails