paru 1.0.0 → 1.0.3

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: 24975da849bee7997a85776e257d620b13ed93d6b389841eaebe5946c0e2db0d
4
+ data.tar.gz: 861159dc635fdbea547993a479010890b2183cb37b72e20a44b507efd44bcc00
5
5
  SHA512:
6
- metadata.gz: 9866df62f18f6f929546dcd6b697b4ed8dfc6cc9c2a3a4f9d2f0623a2f79e4fff524aaf4558c185e24527987474a7e737b4ce288662e2169a6e417f7bd931de5
7
- data.tar.gz: 8e18948789ae07df6ee6ee0d97c33fef28db223a5dc3e37872dc443baede147ed06858c2c980b71b367b8d64da3e770b3bd608ccfefd393972a6c5937d08b998
6
+ metadata.gz: 014d9483bd9a25af560d615f2af241febd6578df578d0635215ea4368cb6e132e00f07ddf105597c60df5b381ac3934bc3d33e1309ac102212eb47ce929313e7
7
+ data.tar.gz: 826338759e77839a66968c0105c3a7e90ed08023e0d3dd9b031d62142024686b80642a8a503eef700ad46b22d936277d45e8b5c7d4d046c29f380edac4ed3f68
@@ -30,7 +30,10 @@ module Paru
30
30
  def initialize(contents)
31
31
  super []
32
32
  contents.each do |item|
33
- @children.push DefinitionListItem.new item
33
+ child = DefinitionListItem.new item
34
+ child.parent = self
35
+
36
+ @children.push child
34
37
  end
35
38
  end
36
39
 
@@ -37,8 +37,15 @@ module Paru
37
37
  #
38
38
  # @param item [Array] the [term, definition]
39
39
  def initialize(item)
40
+ super []
41
+
40
42
  @term = Block.new item[0]
43
+ @term.parent = self
44
+ @children << @term
45
+
41
46
  @definition = List.new item[1]
47
+ @definition.parent = self
48
+ @children << @definition
42
49
  end
43
50
 
44
51
  # Create an AST representation of this DefinitionListItem
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright 2015, 2016, 2017 Huub de Beer <Huub@heerdebeer.org>
2
+ # Copyright 2015, 2016, 2017, 2022 Huub de Beer <Huub@heerdebeer.org>
3
3
  #
4
4
  # This file is part of Paru
5
5
  #
@@ -90,6 +90,7 @@ no_check_certificate: true
90
90
  # Options affecting specific writers
91
91
  #####
92
92
  self_contained: true
93
+ embed_resources: true
93
94
  html_q_tags: true
94
95
  ascii: true
95
96
  reference_links: true
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, 3].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.3
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-08-07 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
@@ -110,14 +110,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: 2.7.6
113
+ version: 2.6.8
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  requirements: []
120
- rubygems_version: 3.2.3
120
+ rubygems_version: 3.3.7
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Paru is a ruby wrapper around pandoc