html-to-markdown 3.19.0 → 3.21.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: e42d1e5a9c4cab13d5840556d5e6a518aa98576495b6fe08cf376a93392d8ba5
4
- data.tar.gz: 7e20b6da6705d9bcf643ee55dccd5b0de4131b170236c2bf9785eed5dd048133
3
+ metadata.gz: 15f402f9dda7241decfc22f13ad4914661924ac16828888e8869be4a330c58e6
4
+ data.tar.gz: a4160304d6e89d800d30c873fa836ba9bbabb99ef7abbbcb14deba9598dce74a
5
5
  SHA512:
6
- metadata.gz: 9510c005552e50c8397a8db398cc8f63e5d57dbd5ca889c96077019d2db9f60f63fd1a14a234d3836752aedae0620919a07d6c90b8bf5fce5dbded58c0d49f1a
7
- data.tar.gz: a79521d8aa524eb9261167d71fd56a1fffa31ec7a1f2a4458ba3076d968d1361f18b96ca5f907d596120f0ad84e743ecd2e1d62f78f0582af1dd3b523845fb6c
6
+ metadata.gz: 22e024bb02c9080414e5fef70298f95616659360925644fa2ae4112455bba6ebf4f69e44ae8200185bd94226249ec58d0db4b0637895caff975d4efcc3f1f3cd
7
+ data.tar.gz: e1317218cd188ffa0da59e86110f70a1a262fe6bfbe266297993e7518a68a7b30345117157456e69968165ca2210a06125e27d9752fa324c572ff4a3dfbeafaa
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- This file is auto-generated by alef — DO NOT EDIT. -->
2
- <!-- alef:hash:cb80328456dcb271efa3f7851e475022ff26cfe3112b09a2e41384313ff520d0 -->
2
+ <!-- alef:hash:cef2039678dca43690ca25831e1f26c8093fb9ed088d15c4faa6cfd46a216194 -->
3
3
  <!-- To regenerate: alef readme -->
4
4
  <!-- To verify freshness: alef verify -->
5
5
 
@@ -100,7 +100,7 @@ Ship identical Markdown across every runtime while enjoying native extension per
100
100
  gem install html-to-markdown
101
101
  ```
102
102
 
103
- Requires Ruby 3.2+ with Magnus native extension bindings. Published for Linux, macOS.
103
+ Requires Ruby 3.3+ with Magnus native extension bindings. Published for Linux, macOS.
104
104
 
105
105
  ## Performance Snapshot
106
106
 
@@ -31,10 +31,10 @@ dependencies = [
31
31
  ]
32
32
 
33
33
  [[package]]
34
- name = "astral-tl"
35
- version = "0.8.0"
34
+ name = "astral-html"
35
+ version = "0.0.4"
36
36
  source = "registry+https://github.com/rust-lang/crates.io-index"
37
- checksum = "04d4bb5df351abb6758a04240b0193794ddaf34a7c0b9452fab3c25dcce39e88"
37
+ checksum = "d050c4dc17bfd8bf50da08bda9ef724b44a1b4ec09a5811f193f978cb6fbadbb"
38
38
  dependencies = [
39
39
  "memchr",
40
40
  ]
@@ -252,7 +252,7 @@ checksum = "491194d601b4fa9fac3c9571e014070a0ad1bc3392d1bc10419695196a8b3cc3"
252
252
 
253
253
  [[package]]
254
254
  name = "html-to-markdown-rb"
255
- version = "3.19.0"
255
+ version = "3.21.0"
256
256
  dependencies = [
257
257
  "async-trait",
258
258
  "html-to-markdown-rs",
@@ -266,12 +266,12 @@ dependencies = [
266
266
 
267
267
  [[package]]
268
268
  name = "html-to-markdown-rs"
269
- version = "3.19.0"
269
+ version = "3.21.0"
270
270
  source = "registry+https://github.com/rust-lang/crates.io-index"
271
- checksum = "ddada45be32a036999fbda2be5df286dc2001816e60099ec3fd445fc6c3bb69b"
271
+ checksum = "1508f37b10916e398625bcce1e4d19da5a04786d25de2996e2e4579c0e800a22"
272
272
  dependencies = [
273
273
  "ahash",
274
- "astral-tl",
274
+ "astral-html",
275
275
  "base64",
276
276
  "bitflags",
277
277
  "html-escape",
@@ -283,6 +283,7 @@ dependencies = [
283
283
  "regex",
284
284
  "serde",
285
285
  "serde_json",
286
+ "smallvec",
286
287
  "thiserror",
287
288
  "tracing",
288
289
  "url",
@@ -485,9 +486,9 @@ dependencies = [
485
486
 
486
487
  [[package]]
487
488
  name = "log"
488
- version = "0.4.34"
489
+ version = "0.4.35"
489
490
  source = "registry+https://github.com/rust-lang/crates.io-index"
490
- checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
491
+ checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c"
491
492
 
492
493
  [[package]]
493
494
  name = "magnus"
@@ -1072,9 +1073,18 @@ dependencies = [
1072
1073
 
1073
1074
  [[package]]
1074
1075
  name = "utf8_iter"
1075
- version = "1.0.4"
1076
+ version = "1.1.0"
1077
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1078
+ checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0"
1079
+ dependencies = [
1080
+ "utf_types",
1081
+ ]
1082
+
1083
+ [[package]]
1084
+ name = "utf_types"
1085
+ version = "1.0.0"
1076
1086
  source = "registry+https://github.com/rust-lang/crates.io-index"
1077
- checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
1087
+ checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6"
1078
1088
 
1079
1089
  [[package]]
1080
1090
  name = "version_check"
@@ -1,11 +1,11 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:fa3a53f518517843e506e230f22cd23c0afd1bcead1c05e1f1d17a72039f3f7d
2
+ # alef:hash:99bb12a622d006aa5ffe8246e71c811f228cb7525070d61578a5fb1e85c3be45
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
 
6
6
  [package]
7
7
  name = "html-to-markdown-rb"
8
- version = "3.19.0"
8
+ version = "3.21.0"
9
9
  edition = "2024"
10
10
  authors = ["Na'aman Hirschfeld <naaman@xberg.io>", "Tobias Perlstein <tobias@xberg.io>"]
11
11
  license = "MIT"
@@ -31,7 +31,7 @@ visitor = ["html-to-markdown-rs/visitor"]
31
31
 
32
32
  [dependencies]
33
33
  async-trait = "0.1"
34
- html-to-markdown-rs = { version = "3.19.0", features = ["serde", "metadata", "visitor", "inline-images", "testkit"] }
34
+ html-to-markdown-rs = { version = "3.21.0", features = ["serde", "metadata", "visitor", "inline-images", "testkit"] }
35
35
  magnus = "0.9"
36
36
  rb-sys = ">=0.9.130, <0.10"
37
37
  serde = { version = "1", features = ["derive"] }
@@ -1,5 +1,5 @@
1
1
  // This file is auto-generated by alef. DO NOT EDIT.
2
- // alef:hash:4b8dded025d0cab583492c692b2a248f959abe1e38e464768e056b4624f1bb5e
2
+ // alef:hash:400e845c128395e5bc9553bc48841d62d847fc1925e8b1343b42e4926ac2fe5e
3
3
  // Re-generate with: alef generate
4
4
  #![allow(dead_code, unused_imports, unused_variables)]
5
5
  #![allow(
@@ -2957,6 +2957,7 @@ pub struct NodeContext {
2957
2957
  index_in_parent: usize,
2958
2958
  parent_tag: Option<String>,
2959
2959
  is_inline: bool,
2960
+ attributes: HashMap<String, String>,
2960
2961
  }
2961
2962
 
2962
2963
  #[cfg(feature = "visitor")]
@@ -3057,6 +3058,15 @@ impl NodeContext {
3057
3058
  })?,
3058
3059
  None => Default::default(),
3059
3060
  },
3061
+ attributes: match kwargs.get(ruby.to_symbol("attributes")) {
3062
+ Some(v) => <HashMap<String, String>>::try_convert(v).map_err(|e| {
3063
+ magnus::Error::new(
3064
+ unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
3065
+ format!("invalid value for `attributes`: {}", e),
3066
+ )
3067
+ })?,
3068
+ None => Default::default(),
3069
+ },
3060
3070
  })
3061
3071
  }
3062
3072
 
@@ -3085,12 +3095,7 @@ impl NodeContext {
3085
3095
  }
3086
3096
 
3087
3097
  fn attributes(&self) -> HashMap<String, String> {
3088
- let core_self = html_to_markdown_rs::NodeContext::from(self.clone());
3089
- core_self
3090
- .attributes()
3091
- .iter()
3092
- .map(|(k, v)| (k.clone(), v.clone()))
3093
- .collect()
3098
+ self.attributes.clone()
3094
3099
  }
3095
3100
 
3096
3101
  #[allow(
@@ -5411,6 +5416,11 @@ fn nodecontext_to_rb_hash(ctx: &html_to_markdown_rs::NodeContext) -> magnus::RHa
5411
5416
  )
5412
5417
  .ok();
5413
5418
  h.aset(ruby.to_symbol("is_inline"), ctx.is_inline).ok();
5419
+ let attributes_hash = ruby.hash_new();
5420
+ for (key, value) in ctx.attributes() {
5421
+ attributes_hash.aset(ruby.str_new(key), ruby.str_new(value)).ok();
5422
+ }
5423
+ h.aset(ruby.to_symbol("attributes"), attributes_hash).ok();
5414
5424
  h
5415
5425
  }
5416
5426
 
@@ -7575,13 +7585,16 @@ impl From<html_to_markdown_rs::MetadataEntry> for MetadataEntry {
7575
7585
  }
7576
7586
 
7577
7587
  #[cfg(feature = "visitor")]
7578
- #[allow(clippy::useless_conversion)]
7588
+ #[allow(clippy::redundant_closure, clippy::useless_conversion)]
7579
7589
  impl From<NodeContext> for html_to_markdown_rs::NodeContext<'_> {
7580
7590
  fn from(val: NodeContext) -> Self {
7581
7591
  html_to_markdown_rs::NodeContext::with_owned_attributes(
7582
7592
  val.node_type.into(),
7583
7593
  val.tag_name.into(),
7584
- std::collections::BTreeMap::new(),
7594
+ val.attributes
7595
+ .iter()
7596
+ .map(|(k, v)| (k.clone(), v.clone()))
7597
+ .collect::<std::collections::BTreeMap<_, _>>(),
7585
7598
  val.depth,
7586
7599
  val.index_in_parent,
7587
7600
  val.parent_tag.map(Into::into),
@@ -7595,6 +7608,12 @@ impl From<NodeContext> for html_to_markdown_rs::NodeContext<'_> {
7595
7608
  impl From<html_to_markdown_rs::NodeContext<'_>> for NodeContext {
7596
7609
  fn from(val: html_to_markdown_rs::NodeContext<'_>) -> Self {
7597
7610
  Self {
7611
+ attributes: val
7612
+ .attributes()
7613
+ .clone()
7614
+ .into_iter()
7615
+ .map(|(k, v)| (k.into(), v.into()))
7616
+ .collect(),
7598
7617
  node_type: val.node_type.into(),
7599
7618
  tag_name: val.tag_name.to_string(),
7600
7619
  depth: val.depth,
@@ -9104,14 +9123,15 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
9104
9123
  )?;
9105
9124
 
9106
9125
  let conversion_error_class = module.define_error("ConversionError", ruby.exception_standard_error())?;
9107
- let parse_error_class = module.define_error("ParseError", conversion_error_class)?;
9108
- let sanitization_error_class = module.define_error("SanitizationError", conversion_error_class)?;
9109
- let config_error_class = module.define_error("ConfigError", conversion_error_class)?;
9110
- let io_error_class = module.define_error("IoError", conversion_error_class)?;
9111
- let panic_error_class = module.define_error("PanicError", conversion_error_class)?;
9112
- let invalid_input_error_class = module.define_error("InvalidInputError", conversion_error_class)?;
9113
- let input_too_large_error_class = module.define_error("InputTooLargeError", conversion_error_class)?;
9114
- let other_error_class = module.define_error("OtherError", conversion_error_class)?;
9126
+ module.define_error("ParseError", conversion_error_class)?;
9127
+ module.define_error("SanitizationError", conversion_error_class)?;
9128
+ module.define_error("ConfigError", conversion_error_class)?;
9129
+ module.define_error("IoError", conversion_error_class)?;
9130
+ module.define_error("PanicError", conversion_error_class)?;
9131
+ module.define_error("InvalidInputError", conversion_error_class)?;
9132
+ module.define_error("InputTooLargeError", conversion_error_class)?;
9133
+ module.define_error("OtherError", conversion_error_class)?;
9134
+ module.funcall::<_, _, magnus::Value>("module_eval", ("class ConversionError\n module Family; end\n include Family\n def self.===(other)\n super || (equal?(ConversionError) && Family === other)\n end\nend",))?;
9115
9135
 
9116
9136
  Ok(())
9117
9137
  }
@@ -1,5 +1,5 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:09a04cb502ed10072dd986b919b61b19dd89f1684de6b0ec0ad98dbc4a7f9805
2
+ # alef:hash:299c795cac1725ee5096f21cf00f81cdcbd4aff13fae056be3fb44d637926bea
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
  # frozen_string_literal: true
@@ -386,7 +386,7 @@ module HtmlToMarkdown
386
386
  # @return [self]
387
387
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
388
388
  def self.from_hash(hash)
389
- new(url: hash[:url] || hash["url"], title: hash[:title] || hash["title"])
389
+ new(url: hash.key?(:url) ? hash[:url] : hash["url"], title: hash.key?(:title) ? hash[:title] : hash["title"])
390
390
  end
391
391
  end
392
392
  end
@@ -480,7 +480,7 @@ module HtmlToMarkdown
480
480
  # @return [self]
481
481
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
482
482
  def self.from_hash(hash)
483
- new(level: hash[:level] || hash["level"], text: hash[:text] || hash["text"])
483
+ new(level: hash.key?(:level) ? hash[:level] : hash["level"], text: hash.key?(:text) ? hash[:text] : hash["text"])
484
484
  end
485
485
  end
486
486
  ## A paragraph of text.
@@ -521,7 +521,7 @@ module HtmlToMarkdown
521
521
  # @return [self]
522
522
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
523
523
  def self.from_hash(hash)
524
- new(text: hash[:text] || hash["text"])
524
+ new(text: hash.key?(:text) ? hash[:text] : hash["text"])
525
525
  end
526
526
  end
527
527
  ## A list container (ordered or unordered). Children are `ListItem` nodes.
@@ -562,7 +562,7 @@ module HtmlToMarkdown
562
562
  # @return [self]
563
563
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
564
564
  def self.from_hash(hash)
565
- new(ordered: hash[:ordered] || hash["ordered"])
565
+ new(ordered: hash.key?(:ordered) ? hash[:ordered] : hash["ordered"])
566
566
  end
567
567
  end
568
568
  ## A single list item.
@@ -603,7 +603,7 @@ module HtmlToMarkdown
603
603
  # @return [self]
604
604
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
605
605
  def self.from_hash(hash)
606
- new(text: hash[:text] || hash["text"])
606
+ new(text: hash.key?(:text) ? hash[:text] : hash["text"])
607
607
  end
608
608
  end
609
609
  ## A table with structured cell data.
@@ -644,7 +644,7 @@ module HtmlToMarkdown
644
644
  # @return [self]
645
645
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
646
646
  def self.from_hash(hash)
647
- new(grid: hash[:grid] || hash["grid"])
647
+ new(grid: hash.key?(:grid) ? hash[:grid] : hash["grid"])
648
648
  end
649
649
  end
650
650
  ## An image element.
@@ -692,9 +692,9 @@ module HtmlToMarkdown
692
692
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
693
693
  def self.from_hash(hash)
694
694
  new(
695
- description: hash[:description] || hash["description"],
696
- src: hash[:src] || hash["src"],
697
- image_index: hash[:image_index] || hash["image_index"]
695
+ description: hash.key?(:description) ? hash[:description] : hash["description"],
696
+ src: hash.key?(:src) ? hash[:src] : hash["src"],
697
+ image_index: hash.key?(:image_index) ? hash[:image_index] : hash["image_index"]
698
698
  )
699
699
  end
700
700
  end
@@ -739,7 +739,10 @@ module HtmlToMarkdown
739
739
  # @return [self]
740
740
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
741
741
  def self.from_hash(hash)
742
- new(text: hash[:text] || hash["text"], language: hash[:language] || hash["language"])
742
+ new(
743
+ text: hash.key?(:text) ? hash[:text] : hash["text"],
744
+ language: hash.key?(:language) ? hash[:language] : hash["language"]
745
+ )
743
746
  end
744
747
  end
745
748
  ## A block quote container.
@@ -859,7 +862,10 @@ module HtmlToMarkdown
859
862
  # @return [self]
860
863
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
861
864
  def self.from_hash(hash)
862
- new(term: hash[:term] || hash["term"], definition: hash[:definition] || hash["definition"])
865
+ new(
866
+ term: hash.key?(:term) ? hash[:term] : hash["term"],
867
+ definition: hash.key?(:definition) ? hash[:definition] : hash["definition"]
868
+ )
863
869
  end
864
870
  end
865
871
  ## A raw block preserved as-is (e.g. `<script>`, `<style>` content).
@@ -903,7 +909,10 @@ module HtmlToMarkdown
903
909
  # @return [self]
904
910
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
905
911
  def self.from_hash(hash)
906
- new(format: hash[:format] || hash["format"], content: hash[:content] || hash["content"])
912
+ new(
913
+ format: hash.key?(:format) ? hash[:format] : hash["format"],
914
+ content: hash.key?(:content) ? hash[:content] : hash["content"]
915
+ )
907
916
  end
908
917
  end
909
918
  ## A block of key-value metadata pairs (from `<head>` meta tags).
@@ -944,7 +953,7 @@ module HtmlToMarkdown
944
953
  # @return [self]
945
954
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
946
955
  def self.from_hash(hash)
947
- new(entries: hash[:entries] || hash["entries"])
956
+ new(entries: hash.key?(:entries) ? hash[:entries] : hash["entries"])
948
957
  end
949
958
  end
950
959
  ## A section grouping container (auto-generated from heading hierarchy).
@@ -992,9 +1001,9 @@ module HtmlToMarkdown
992
1001
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
993
1002
  def self.from_hash(hash)
994
1003
  new(
995
- label: hash[:label] || hash["label"],
996
- heading_level: hash[:heading_level] || hash["heading_level"],
997
- heading_text: hash[:heading_text] || hash["heading_text"]
1004
+ label: hash.key?(:label) ? hash[:label] : hash["label"],
1005
+ heading_level: hash.key?(:heading_level) ? hash[:heading_level] : hash["heading_level"],
1006
+ heading_text: hash.key?(:heading_text) ? hash[:heading_text] : hash["heading_text"]
998
1007
  )
999
1008
  end
1000
1009
  end
@@ -1081,7 +1090,7 @@ module HtmlToMarkdown
1081
1090
  # @return [self]
1082
1091
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
1083
1092
  def self.from_hash(hash)
1084
- new(value: hash[:output] || hash["output"])
1093
+ new(value: hash.key?(:output) ? hash[:output] : hash["output"])
1085
1094
  end
1086
1095
  end
1087
1096
  ## Skip this element entirely (don't output anything)
@@ -1156,7 +1165,7 @@ module HtmlToMarkdown
1156
1165
  # @return [self]
1157
1166
  sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.attached_class) }
1158
1167
  def self.from_hash(hash)
1159
- new(value: hash[:output] || hash["output"])
1168
+ new(value: hash.key?(:output) ? hash[:output] : hash["output"])
1160
1169
  end
1161
1170
  end
1162
1171
  end
@@ -1,10 +1,10 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:2af93614191f5e65ab3e6f136720482baa1b1ccd900ee7561aeb92a517ef3fe1
2
+ # alef:hash:619922d1aadc86f33a41a722ca732e9be4b5b43e722e085969152b4b5dc3c502
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
  # frozen_string_literal: true
6
6
 
7
7
  module HtmlToMarkdown
8
8
  ## The version string for this package.
9
- VERSION = "3.19.0"
9
+ VERSION = "3.21.0"
10
10
  end
data/sig/types.rbs CHANGED
@@ -1,5 +1,5 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:0715469498b948fa0fede0134e676b43663986d359510ac029708f761e5dd5eb
2
+ # alef:hash:3268ce0b667ca8b7ee33bab52a6acdac2751438fa66a49e6165b34ea272253be
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
 
@@ -238,9 +238,9 @@ def initialize: (href: String, text: String, ?title: String, link_type: enum_Lin
238
238
  attr_reader index_in_parent: Integer
239
239
  attr_reader parent_tag: String?
240
240
  attr_reader is_inline: bool
241
+ attr_reader attributes: Hash[String, String]
241
242
 
242
- def initialize: (node_type: enum_NodeType, tag_name: String, depth: Integer, index_in_parent: Integer, ?parent_tag: String, is_inline: bool) -> void
243
- def attributes: () -> Hash[String, String]
243
+ def initialize: (node_type: enum_NodeType, tag_name: String, depth: Integer, index_in_parent: Integer, ?parent_tag: String, is_inline: bool, ?attributes: Hash[String, String]) -> void
244
244
  def into_owned: () -> NodeContext
245
245
  end
246
246
 
@@ -451,7 +451,7 @@ def initialize: (?rows: Integer, ?cols: Integer, ?cells: Array[GridCell]) -> voi
451
451
  def link?: () -> bool
452
452
 
453
453
  def self.from_hash: (untyped hash) -> untyped
454
- def self.new: (url: String, title: String) -> AnnotationKindLink
454
+ def self.new: (url: String, title: String?) -> AnnotationKindLink
455
455
  end
456
456
 
457
457
  type enum_CodeBlockStyle = :Indented | :Backticks | :Tildes
@@ -610,7 +610,7 @@ def initialize: (?rows: Integer, ?cols: Integer, ?cells: Array[GridCell]) -> voi
610
610
  def group?: () -> bool
611
611
 
612
612
  def self.from_hash: (untyped hash) -> untyped
613
- def self.new: (description: String, src: String, image_index: Integer) -> NodeContentImage
613
+ def self.new: (description: String?, src: String?, image_index: Integer?) -> NodeContentImage
614
614
  end
615
615
 
616
616
  class NodeContentCode
@@ -633,7 +633,7 @@ def initialize: (?rows: Integer, ?cols: Integer, ?cells: Array[GridCell]) -> voi
633
633
  def group?: () -> bool
634
634
 
635
635
  def self.from_hash: (untyped hash) -> untyped
636
- def self.new: (text: String, language: String) -> NodeContentCode
636
+ def self.new: (text: String, language: String?) -> NodeContentCode
637
637
  end
638
638
 
639
639
  class NodeContentQuote
@@ -765,7 +765,7 @@ def self.new: (entries: Array[MetadataEntry]) -> NodeContentMetadataBlock
765
765
  def group?: () -> bool
766
766
 
767
767
  def self.from_hash: (untyped hash) -> untyped
768
- def self.new: (label: String, heading_level: Integer, heading_text: String) -> NodeContentGroup
768
+ def self.new: (label: String?, heading_level: Integer?, heading_text: String?) -> NodeContentGroup
769
769
  end
770
770
 
771
771
  type enum_NodeType = :Text | :Element | :Heading | :Paragraph | :Div | :Blockquote | :Pre | :Hr | :List | :ListItem | :DefinitionList | :DefinitionTerm | :DefinitionDescription | :Table | :TableRow | :TableCell | :TableHeader | :TableBody | :TableHead | :TableFoot | :Link | :Image | :Strong | :Em | :Code | :Strikethrough | :Underline | :Subscript | :Superscript | :Mark | :Small | :Br | :Span | :Article | :Section | :Nav | :Aside | :Header | :Footer | :Main | :Figure | :Figcaption | :Time | :Details | :Summary | :Form | :Input | :Select | :Option | :Button | :Textarea | :Label | :Fieldset | :Legend | :Audio | :Video | :Picture | :Source | :Iframe | :Svg | :Canvas | :Ruby | :Rt | :Rp | :Abbr | :Kbd | :Samp | :Var | :Cite | :Q | :Del | :Ins | :Data | :Meter | :Progress | :Output | :Template | :Slot | :Html | :Head | :Body | :Title | :Meta | :LinkTag | :Style | :Script | :Base | :Custom
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-to-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.19.0
4
+ version: 3.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Na'aman Hirschfeld
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-10-27 00:00:00.000000000 Z
12
+ date: 2026-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb_sys
@@ -83,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
83
  requirements:
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: 3.2.0
86
+ version: 3.3.0
87
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - ">="