markly 0.12.0 → 0.13.0

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
  SHA256:
3
- metadata.gz: 3cd94abddc41f15067801a6e539bc8f9e9243625ad4896c75a226b8d9001fbd8
4
- data.tar.gz: 24eef0d17ac2f066e68689fa6a1dfcae0ac106d5219d5a0df7d41502333a39d2
3
+ metadata.gz: 16f7d1b58c0978a73757f549d15ab5930fce2c7893345b45bc80fd5d7cd29a8f
4
+ data.tar.gz: 2232e3fd1897f656f47720fa6220896d65c6ddeafca87ab25f158d3a7939ddad
5
5
  SHA512:
6
- metadata.gz: c74742176f3f3514e96af7f78d0128ae14ac1b116e3aaccfee37eea6441de208347d2a370509c71782d15147d0414e7940d7e839aa5967561e7df53225eeada0
7
- data.tar.gz: 05ee9e27830fc92fa13c7cc909e0a1fba8221c3b563bcb0c31ec0ece271673cdc402293e382464af529b4e110e46e0a440888d19d9d907f13b299ad88c23ea73
6
+ metadata.gz: 4e8c4a0b0a458edca3865244a1933191f7a01749bef0cc1d9f7137a43d79c65f8de67138a89f8687018954d576a26a46ee85f18621f489d826ef6b262e0f17e2
7
+ data.tar.gz: 58221e79a6a07c53949cb5a8751df4d1d32db5fa3c976ae7ca003909e5e2ed20da4041794a57bb10db51be7baa5e06a28e022fb5d93045b5391f84d82c9d314b
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- IS&f`����cM��S ��=-X{!Q� �D6��F3���ٝnO2j��!x�_|���hËL��퐫�Wz� ۰��i
2
- _�R��s ��:!���
3
- 82��3R8��X
1
+ '%�Sm�k~�PZ�,��d�˝��Lz��]��ώ"T��}�J�ћ�S�.&pɦ���Ѐ��Ue��O�^D�Q����݋A���Nn4 S��VtU|�(3���s��F��O�� z�H�_��51��r
2
+ �s���Tl~��1�<��¿��Q��� f9]B�>�|s�\d^�`e:���aR!B?r��R� ����]��~��������ƻ�P��v�������T}���~�]b�ĺ6��~��ʠ��/�@2a���3������c{
3
+ �� �������]b��]]�՝tK=ё��+\��ėί}ò3r<�ی����^�k�{9kJ�ܥ;)�Zf̲�E �� w�pW��- �>�
data/lib/markly/node.rb CHANGED
@@ -17,7 +17,14 @@ module Markly
17
17
  # Duplicate the current node and all children.
18
18
  def dup
19
19
  # This is a bit crazy, but it's the best I can come up with right now:
20
- Markly.parse(self.to_markdown)
20
+ node = Markly.parse(self.to_markdown)
21
+
22
+ # If we aren't duplicating a document, we return `first_child` as the root will be a document node:
23
+ if self.type == :document
24
+ return node
25
+ else
26
+ return node.first_child
27
+ end
21
28
  end
22
29
 
23
30
  # Public: An iterator that "walks the tree," descending into children recursively.
@@ -142,6 +149,24 @@ module Markly
142
149
  end
143
150
  end
144
151
 
152
+ # Append the given node before the current node.
153
+ #
154
+ # It's okay to provide a document node, it's children will be appended.
155
+ #
156
+ # @parameter node [Markly::Node] the node to append.
157
+ def append_before(node)
158
+ if node.type == :document
159
+ node = node.first_child
160
+ end
161
+
162
+ current = self
163
+ while node
164
+ next_node = node.next
165
+ current.insert_before(node)
166
+ node = next_node
167
+ end
168
+ end
169
+
145
170
  # Extract the children as a fragment.
146
171
  #
147
172
  # @returns [Markly::Node] the fragment.
@@ -7,5 +7,5 @@
7
7
  # Copyright, 2020-2023, by Samuel Williams.
8
8
 
9
9
  module Markly
10
- VERSION = '0.12.0'
10
+ VERSION = '0.13.0'
11
11
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
@@ -24,7 +24,6 @@ authors:
24
24
  - Roberto Hidalgo
25
25
  - Ross Kaffenberger
26
26
  - Vitaliy Klachkov
27
- autorequire:
28
27
  bindir: bin
29
28
  cert_chain:
30
29
  - |
@@ -56,10 +55,8 @@ cert_chain:
56
55
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
57
56
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
58
57
  -----END CERTIFICATE-----
59
- date: 2024-08-19 00:00:00.000000000 Z
58
+ date: 2025-03-22 00:00:00.000000000 Z
60
59
  dependencies: []
61
- description:
62
- email:
63
60
  executables: []
64
61
  extensions:
65
62
  - ext/markly/extconf.rb
@@ -152,7 +149,6 @@ metadata:
152
149
  documentation_uri: https://ioquatix.github.io/markly/
153
150
  funding_uri: https://github.com/sponsors/ioquatix/
154
151
  source_code_uri: https://github.com/ioquatix/markly.git
155
- post_install_message:
156
152
  rdoc_options: []
157
153
  require_paths:
158
154
  - lib
@@ -167,8 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
163
  - !ruby/object:Gem::Version
168
164
  version: '0'
169
165
  requirements: []
170
- rubygems_version: 3.5.11
171
- signing_key:
166
+ rubygems_version: 3.6.2
172
167
  specification_version: 4
173
168
  summary: CommonMark parser and renderer. Written in C, wrapped in Ruby.
174
169
  test_files: []
metadata.gz.sig CHANGED
Binary file