paru 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: d31c824836527183bdaa118455039dcb428dfaf24b48fda1415ddc09d39cb1c0
4
- data.tar.gz: 7ce8dbcb28c40c56821352df0168952535e14682d744a039ab8e281cde529aeb
3
+ metadata.gz: af58fa6fd05693cd3f537542b9fb6a348d343813e3934f6d9e6af23e6f19edcf
4
+ data.tar.gz: b2b06e8c4e7b1f9207052137673f4ffa811d7f64486fda9c6fb2017ae1b991dd
5
5
  SHA512:
6
- metadata.gz: 9866df62f18f6f929546dcd6b697b4ed8dfc6cc9c2a3a4f9d2f0623a2f79e4fff524aaf4558c185e24527987474a7e737b4ce288662e2169a6e417f7bd931de5
7
- data.tar.gz: 8e18948789ae07df6ee6ee0d97c33fef28db223a5dc3e37872dc443baede147ed06858c2c980b71b367b8d64da3e770b3bd608ccfefd393972a6c5937d08b998
6
+ metadata.gz: b7bb653ae6496e3ac42a1580596a9c5784938be998c9c918d57408a3506055ecfed61127202c6fe9333b414a827ceab82632af3a8b41ae738f928caa7e5d97d1
7
+ data.tar.gz: e3e2cc7a87298e49d3c1c168e73d2b9d8d46cabae8891b4d786e65764dc37511c9794b6125a9a1940bef1c39eac14a50494f0af5e5145aff2ec48249f7b7cb35
@@ -31,7 +31,10 @@ module Paru
31
31
  def initialize(contents, node_class = Block)
32
32
  super []
33
33
  contents.each do |item|
34
- @children.push node_class.new item
34
+ child = node_class.new(item)
35
+ child.parent = self
36
+
37
+ @children.push child
35
38
  end
36
39
  end
37
40
 
data/lib/paru/selector.rb CHANGED
@@ -187,8 +187,10 @@ module Paru
187
187
 
188
188
  def is_descendant?(node)
189
189
  distance = 0
190
+ parent = nil
190
191
  begin
191
192
  distance += 1 if @distance > 0
193
+ node = parent unless parent.nil?
192
194
  parent = node.parent
193
195
  ancestry = parent.type == @type and @classes.all? {|c| parent.has_class? c}
194
196
  end while not ancestry and not parent.is_root? and distance <= @distance
data/lib/paru.rb CHANGED
@@ -18,5 +18,5 @@
18
18
  #++
19
19
  module Paru
20
20
  # Paru's current version
21
- VERSION = [1, 0, 0].freeze
21
+ VERSION = [1, 0, 1].freeze
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paru
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Huub de Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-29 00:00:00.000000000 Z
11
+ date: 2022-06-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Control pandoc with Ruby and write pandoc filters in Ruby
14
14
  email: Huub@heerdebeer.org