papercraft 2.18 → 2.20

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: fdb138000feb8d97f7479b8894555cb5d457648f9d11a8afe51c942677235976
4
- data.tar.gz: 5ec07faf07b7ed23781be2825c36039c457bde7d42a440f9c15c503f7d64f9ca
3
+ metadata.gz: 2aaeb902deb28df3d773705b69f22c34d8496009254f6bd8106419651e13e46d
4
+ data.tar.gz: 7d496c4b973b9bc0f96d608956cd8f6941345e751a37f15244f155e9698ac9ab
5
5
  SHA512:
6
- metadata.gz: 99b831bab5992eb0533d85cd25c2b10529d5f052c13ffa8c43dd42c3360b520800f9db1f505b70da41d113d82d495ccaa041944b0578a63af64b08835b63db30
7
- data.tar.gz: 93beefae61238e80e26133adfaf956c6ec9a4e57f07094687a216f20eb489a975dd261e6b370a85dba296770286bdcd32f0907f9ecaeee4278f9d547bf761510
6
+ metadata.gz: 8f1c40175e5ec13cac0573ad58c491a935e7cd0c7198b79b1a37d4b662a304f8468b55b2b6a59ef59816d49d047772a06d3bb8440d2bdc24ba8a8c0e1f0e04f9
7
+ data.tar.gz: 5bad88609d161535014bcbf7cd6dd26775c3ec1f0505a927bcdc65eaea58a623387407e6d5920e3eb8b61982ce592732bf1d14f062ef90e09caa960e8bf35927
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 2.20 2025-10-08
2
+
3
+ - Raise error on void element with child nodes or inner text
4
+ - Fix compilation of empty template
5
+
6
+ # 2.19 2025-10-08
7
+
8
+ - Use gem.coop in Gemfile
9
+
1
10
  # 2.18 2025-10-08
2
11
 
3
12
  - Add `link_stylesheet` extension
@@ -16,6 +16,8 @@ module Papercraft
16
16
  end
17
17
 
18
18
  def self.transform(ast, root)
19
+ return nil if !ast
20
+
19
21
  ast.accept(new(root))
20
22
  end
21
23
 
@@ -165,6 +165,10 @@ module Papercraft
165
165
  is_void = is_void_element?(tag)
166
166
  is_raw_inner_text = is_raw_inner_text_element?(tag)
167
167
 
168
+ if is_void && (node.block || node.inner_text)
169
+ raise Papercraft::Error, "Void element #{tag} cannot contain child nodes or inner text"
170
+ end
171
+
168
172
  emit_html(node.tag_location, format_html_tag_open(node.tag_location, tag, node.attributes))
169
173
  return if is_void
170
174
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Papercraft
4
- VERSION = '2.18'
4
+ VERSION = '2.20'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: papercraft
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.18'
4
+ version: '2.20'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner