html-to-markdown 3.19.0 → 3.20.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: f43865f82a7e4c6d23c66a65771037f4d8ee80030446ffaa3f540b186a63d495
4
+ data.tar.gz: 9153d54e8c57c12d344ad60c428a456f23ad99b986b9c095611ef5209861ca3f
5
5
  SHA512:
6
- metadata.gz: 9510c005552e50c8397a8db398cc8f63e5d57dbd5ca889c96077019d2db9f60f63fd1a14a234d3836752aedae0620919a07d6c90b8bf5fce5dbded58c0d49f1a
7
- data.tar.gz: a79521d8aa524eb9261167d71fd56a1fffa31ec7a1f2a4458ba3076d968d1361f18b96ca5f907d596120f0ad84e743ecd2e1d62f78f0582af1dd3b523845fb6c
6
+ metadata.gz: 23eb08b05df928356dd4d205fb51ab09ed795a73ade15c16e81925eb3abe4d251bea9434ba4b47f8d8ddcb1c1be9d6e291c7c3d42bd67f8d2b9639099b712fd9
7
+ data.tar.gz: 9a64c7eb777837684aec301285b64494e3fe4dcd76e507f079808586e83acf655953cf321796b11339f6e128dd75873ee905a1dd718867cd273556c34de1c1d2
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.20.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.20.0"
270
270
  source = "registry+https://github.com/rust-lang/crates.io-index"
271
- checksum = "ddada45be32a036999fbda2be5df286dc2001816e60099ec3fd445fc6c3bb69b"
271
+ checksum = "87d942a115ed580f0f224aa32114e82b964dcd05a9cfa71b015829d7fafba1b2"
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:2037391b7b71beb6a98065ebcf3cf7a6468bb5565cae33f921c678449cee8a10
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.20.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.20.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:12cba80e3c0806295fe73c09cbd3a6127be840c81ee90b163b8a848eda56f40f
3
3
  // Re-generate with: alef generate
4
4
  #![allow(dead_code, unused_imports, unused_variables)]
5
5
  #![allow(
@@ -9104,14 +9104,15 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
9104
9104
  )?;
9105
9105
 
9106
9106
  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)?;
9107
+ module.define_error("ParseError", conversion_error_class)?;
9108
+ module.define_error("SanitizationError", conversion_error_class)?;
9109
+ module.define_error("ConfigError", conversion_error_class)?;
9110
+ module.define_error("IoError", conversion_error_class)?;
9111
+ module.define_error("PanicError", conversion_error_class)?;
9112
+ module.define_error("InvalidInputError", conversion_error_class)?;
9113
+ module.define_error("InputTooLargeError", conversion_error_class)?;
9114
+ module.define_error("OtherError", conversion_error_class)?;
9115
+ 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
9116
 
9116
9117
  Ok(())
9117
9118
  }
@@ -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:a84c4b56eb2a68cb8ebc1ff8b99fb9aa75fb7b5f3d8e8b4a1481e8847e18814f
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.20.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:1d4b142f8a480d7e1db67239954e5333ef61df246e0597c2429f8c8ec6660510
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
 
@@ -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.20.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
  - - ">="