html-to-markdown 3.22.2 → 3.23.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: 250f9d69cf35f33fc316669add9c0e6c3371c5e8c7fc79b4174a01851f103fef
4
- data.tar.gz: 53b086a41687ed8a94f4d1dda40dfb85a9a92722f75dda3d7d313700dd02954e
3
+ metadata.gz: 2a7915c3c793c6b9a8a26ce77469bba5a76eb0f52ae8e30ffe7da36c2000efe2
4
+ data.tar.gz: 85c9f0ecdb5930a2d6742c315d8d2fc5e773da28d38ad6b7530a73335e7682c2
5
5
  SHA512:
6
- metadata.gz: 6458c8851c34347f5d38575a242762a3f8ee926c5e24948714c70594e4ca03a3a8a35ded73d69e85e2a55ff16b1013b9906c92a79ac129b3f9dd0a8f385aa24b
7
- data.tar.gz: 6ee2ec64371bfcbe2355f92b62706e7ff4ed08cb59349aed532528582b009ff3b07192876f0ad1f679896b154d1e5c7b505439885bb957b2bc6d9cc65a366160
6
+ metadata.gz: 14812bdce5b94806914f8985b4710beaadc36f0b22f39127252182f6c0938b6107257b8162668a73563f84c7c6644a8bf91b6769146b42d2916223e4df675a4b
7
+ data.tar.gz: 18fb4caae2239e344bd0d868c956d9521e54c7b812c4c7d45858ae08b28bad1130e64ad220d3a371cc60d0fc09b6ad083e17c6ee1d0ac7815434d09f7eeb25de
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- This file is auto-generated by alef — DO NOT EDIT. -->
2
- <!-- alef:hash:cef2039678dca43690ca25831e1f26c8093fb9ed088d15c4faa6cfd46a216194 -->
2
+ <!-- alef:hash:b8dafc329b76755b4336b3e68e409e3633df95ddaaf2a058ce0db33408454d56 -->
3
3
  <!-- To regenerate: alef readme -->
4
4
  <!-- To verify freshness: alef verify -->
5
5
 
@@ -331,8 +331,8 @@ markdown = result.content
331
331
  ## Part of Xberg.io
332
332
 
333
333
  - [Xberg](https://github.com/xberg-io/xberg) — the open-source content-intelligence engine: text, tables, and metadata from 101 formats (115 file extensions), with OCR, transcription, and code intelligence. MIT.
334
- - [Xberg Pro](https://xberg.io) — a complete self-hosted content-intelligence backend in a single container. Commercial.
335
- - [Xberg Enterprise](https://xberg.io) — the distributed, governed content-intelligence platform, scaled on Kubernetes with team governance and support. Commercial.
334
+ - [Xberg Pro](https://pro.xberg.io) — a complete self-hosted content-intelligence backend in a single container. Commercial.
335
+ - [Xberg Enterprise](https://pro.xberg.io) — the distributed, governed content-intelligence platform, scaled on Kubernetes with team governance and support. Commercial.
336
336
  - [crawlberg](https://github.com/xberg-io/crawlberg) — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
337
337
  - [html-to-markdown](https://github.com/xberg-io/html-to-markdown) — fast, lossless HTML→Markdown engine.
338
338
  - [liter-llm](https://github.com/xberg-io/liter-llm) — universal LLM API client with native bindings for 14 languages and 165 providers.
@@ -252,7 +252,7 @@ checksum = "d45ed4d99334da2a2f221504e8ffc8ad09baf2a452b154465a976bfde697b004"
252
252
 
253
253
  [[package]]
254
254
  name = "html-to-markdown-rb"
255
- version = "3.22.2"
255
+ version = "3.23.0"
256
256
  dependencies = [
257
257
  "async-trait",
258
258
  "html-to-markdown-rs",
@@ -266,9 +266,9 @@ dependencies = [
266
266
 
267
267
  [[package]]
268
268
  name = "html-to-markdown-rs"
269
- version = "3.22.2"
269
+ version = "3.23.0"
270
270
  source = "registry+https://github.com/rust-lang/crates.io-index"
271
- checksum = "cc25843401cb581993980ff11045d093aa36751fbe2abbe88383f9721d9bb091"
271
+ checksum = "90875b5ee77c56850bd6868ee83822bbe306cde81bd282981dbe6c983b6d4369"
272
272
  dependencies = [
273
273
  "ahash",
274
274
  "astral-html",
@@ -1,11 +1,11 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:dfbcd4c34d9488638210e3e1ca19549470746c7cf2b34757b4e8c676def94064
2
+ # alef:hash:fec51732cad6c7634eeeaeb1fc1315a6ad7f1c70253839db38d51295e8fe76cf
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.22.2"
8
+ version = "3.23.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.22.2", features = ["serde", "metadata", "visitor", "inline-images", "testkit"] }
34
+ html-to-markdown-rs = { version = "3.23.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:0ab17b85500fe9ee2d3f492e0587a2f270186c5abf891ec76713314c19bcd537
2
+ // alef:hash:1b9f375633b668a39881369fa54d0b0616d659bf01e20c1b2bd7d6de2208af55
3
3
  // Re-generate with: alef generate
4
4
  #![allow(dead_code, unused_imports, unused_variables)]
5
5
  #![allow(
@@ -109,6 +109,7 @@ pub struct ConversionOptions {
109
109
  infer_dimensions: bool,
110
110
  max_depth: Option<usize>,
111
111
  exclude_selectors: Vec<String>,
112
+ data_as_elements: Option<Vec<String>>,
112
113
  tier_strategy: TierStrategy,
113
114
  base_url: Option<String>,
114
115
  }
@@ -577,6 +578,15 @@ impl ConversionOptions {
577
578
  })?,
578
579
  None => Default::default(),
579
580
  },
581
+ data_as_elements: match kwargs.get(ruby.to_symbol("data_as_elements")).filter(|v| !v.is_nil()) {
582
+ Some(v) => Some(<Vec<String>>::try_convert(v).map_err(|e| {
583
+ magnus::Error::new(
584
+ unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
585
+ format!("invalid value for `data_as_elements`: {}", e),
586
+ )
587
+ })?),
588
+ None => None,
589
+ },
580
590
  tier_strategy: match kwargs.get(ruby.to_symbol("tier_strategy")) {
581
591
  Some(v) => TierStrategy::try_convert(v).map_err(|e| {
582
592
  magnus::Error::new(
@@ -786,6 +796,10 @@ impl ConversionOptions {
786
796
  self.exclude_selectors.clone()
787
797
  }
788
798
 
799
+ fn data_as_elements(&self) -> Option<Vec<String>> {
800
+ self.data_as_elements.clone()
801
+ }
802
+
789
803
  fn tier_strategy(&self) -> TierStrategy {
790
804
  self.tier_strategy.clone()
791
805
  }
@@ -846,6 +860,7 @@ pub struct ConversionOptionsUpdate {
846
860
  infer_dimensions: Option<bool>,
847
861
  max_depth: Option<usize>,
848
862
  exclude_selectors: Option<Vec<String>>,
863
+ data_as_elements: Option<Vec<String>>,
849
864
  tier_strategy: Option<TierStrategy>,
850
865
  base_url: Option<String>,
851
866
  }
@@ -1326,6 +1341,15 @@ impl ConversionOptionsUpdate {
1326
1341
  })?),
1327
1342
  None => None,
1328
1343
  },
1344
+ data_as_elements: match kwargs.get(ruby.to_symbol("data_as_elements")).filter(|v| !v.is_nil()) {
1345
+ Some(v) => Some(<Vec<String>>::try_convert(v).map_err(|e| {
1346
+ magnus::Error::new(
1347
+ unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
1348
+ format!("invalid value for `data_as_elements`: {}", e),
1349
+ )
1350
+ })?),
1351
+ None => None,
1352
+ },
1329
1353
  tier_strategy: match kwargs.get(ruby.to_symbol("tier_strategy")).filter(|v| !v.is_nil()) {
1330
1354
  Some(v) => Some(TierStrategy::try_convert(v).map_err(|e| {
1331
1355
  magnus::Error::new(
@@ -1535,6 +1559,10 @@ impl ConversionOptionsUpdate {
1535
1559
  self.exclude_selectors.clone()
1536
1560
  }
1537
1561
 
1562
+ fn data_as_elements(&self) -> Option<Vec<String>> {
1563
+ self.data_as_elements.clone()
1564
+ }
1565
+
1538
1566
  fn tier_strategy(&self) -> Option<TierStrategy> {
1539
1567
  self.tier_strategy.clone()
1540
1568
  }
@@ -7092,7 +7120,7 @@ impl html_to_markdown_rs::visitor::HtmlVisitor for RbHtmlVisitorBridge {
7092
7120
  }
7093
7121
 
7094
7122
  #[allow(clippy::needless_update)]
7095
- #[allow(clippy::useless_conversion)]
7123
+ #[allow(clippy::redundant_closure, clippy::useless_conversion)]
7096
7124
  impl From<ConversionOptions> for html_to_markdown_rs::options::ConversionOptions {
7097
7125
  fn from(val: ConversionOptions) -> Self {
7098
7126
  Self {
@@ -7143,6 +7171,7 @@ impl From<ConversionOptions> for html_to_markdown_rs::options::ConversionOptions
7143
7171
  infer_dimensions: val.infer_dimensions,
7144
7172
  max_depth: val.max_depth,
7145
7173
  exclude_selectors: val.exclude_selectors.into_iter().collect(),
7174
+ data_as_elements: val.data_as_elements.map(|v| v.into_iter().collect()),
7146
7175
  tier_strategy: val.tier_strategy.into(),
7147
7176
  base_url: val.base_url,
7148
7177
  ..Default::default()
@@ -7201,6 +7230,7 @@ impl From<html_to_markdown_rs::options::ConversionOptions> for ConversionOptions
7201
7230
  infer_dimensions: val.infer_dimensions,
7202
7231
  max_depth: val.max_depth,
7203
7232
  exclude_selectors: val.exclude_selectors.into_iter().collect(),
7233
+ data_as_elements: val.data_as_elements.map(|v| v.into_iter().collect()),
7204
7234
  tier_strategy: val.tier_strategy.into(),
7205
7235
  base_url: val.base_url.map(|v| v.to_string()),
7206
7236
  }
@@ -7258,6 +7288,7 @@ impl From<html_to_markdown_rs::options::ConversionOptionsUpdate> for ConversionO
7258
7288
  infer_dimensions: val.infer_dimensions,
7259
7289
  max_depth: val.max_depth.flatten(),
7260
7290
  exclude_selectors: val.exclude_selectors.map(|v| v.into_iter().collect()),
7291
+ data_as_elements: val.data_as_elements.map(|v| v.into_iter().collect()),
7261
7292
  tier_strategy: val.tier_strategy.map(Into::into),
7262
7293
  base_url: val.base_url.flatten().map(|v| v.to_string()),
7263
7294
  }
@@ -8652,6 +8683,8 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
8652
8683
 
8653
8684
  class.define_method("exclude_selectors", method!(ConversionOptions::exclude_selectors, 0))?;
8654
8685
 
8686
+ class.define_method("data_as_elements", method!(ConversionOptions::data_as_elements, 0))?;
8687
+
8655
8688
  class.define_method("tier_strategy", method!(ConversionOptions::tier_strategy, 0))?;
8656
8689
 
8657
8690
  class.define_method("base_url", method!(ConversionOptions::base_url, 0))?;
@@ -8802,6 +8835,11 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
8802
8835
  method!(ConversionOptionsUpdate::exclude_selectors, 0),
8803
8836
  )?;
8804
8837
 
8838
+ class.define_method(
8839
+ "data_as_elements",
8840
+ method!(ConversionOptionsUpdate::data_as_elements, 0),
8841
+ )?;
8842
+
8805
8843
  class.define_method("tier_strategy", method!(ConversionOptionsUpdate::tier_strategy, 0))?;
8806
8844
 
8807
8845
  class.define_method("base_url", method!(ConversionOptionsUpdate::base_url, 0))?;
@@ -1,10 +1,10 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:b58353cdc485cc2bc885f8017c338dee638ee9bb6df44a5d2f89950a2cb7b2e7
2
+ # alef:hash:52d725d5657cf8b22d0c034ce68ca9ee0874d1ae93cbfb92298ec633e027d1f2
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.22.2"
9
+ VERSION = "3.23.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:3268ce0b667ca8b7ee33bab52a6acdac2751438fa66a49e6165b34ea272253be
2
+ # alef:hash:664df70a39c5e87001f1dda8aa53b3c83eb1aa155b1a9a6e5c24e4744b56d0b3
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
 
@@ -57,11 +57,12 @@ type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Fl
57
57
  attr_reader infer_dimensions: bool
58
58
  attr_reader max_depth: Integer?
59
59
  attr_reader exclude_selectors: Array[String]
60
+ attr_reader data_as_elements: Array[String]?
60
61
  attr_reader tier_strategy: enum_TierStrategy
61
62
  attr_reader base_url: String?
62
63
  attr_reader visitor: VisitorHandle?
63
64
 
64
- def initialize: (?heading_style: enum_HeadingStyle, ?list_indent_type: enum_ListIndentType, ?list_indent_width: Integer, ?bullets: String, ?strong_em_symbol: String, ?escape_asterisks: bool, ?escape_underscores: bool, ?escape_misc: bool, ?escape_ascii: bool, ?code_language: String, ?autolinks: bool, ?expand_abbreviations: bool, ?include_blockquote_citations: bool, ?default_title: bool, ?br_in_tables: bool, ?compact_tables: bool, ?highlight_style: enum_HighlightStyle, ?extract_metadata: bool, ?whitespace_mode: enum_WhitespaceMode, ?strip_newlines: bool, ?wrap: bool, ?wrap_width: Integer, ?convert_as_inline: bool, ?sub_symbol: String, ?sup_symbol: String, ?newline_style: enum_NewlineStyle, ?code_block_style: enum_CodeBlockStyle, ?keep_inline_images_in: Array[String], ?preprocessing: PreprocessingOptions, ?encoding: String, ?debug: bool, ?strip_tags: Array[String], ?preserve_tags: Array[String], ?skip_images: bool, ?inline_data_media: enum_InlineDataMedia, ?hidden_content: enum_HiddenContent, ?url_escape_style: enum_UrlEscapeStyle, ?link_style: enum_LinkStyle, ?output_format: enum_OutputFormat, ?include_document_structure: bool, ?extract_images: bool, ?max_image_size: Integer, ?max_input_size: Integer, ?capture_svg: bool, ?infer_dimensions: bool, ?max_depth: Integer, ?exclude_selectors: Array[String], ?tier_strategy: enum_TierStrategy, ?base_url: String, ?visitor: VisitorHandle) -> void
65
+ def initialize: (?heading_style: enum_HeadingStyle, ?list_indent_type: enum_ListIndentType, ?list_indent_width: Integer, ?bullets: String, ?strong_em_symbol: String, ?escape_asterisks: bool, ?escape_underscores: bool, ?escape_misc: bool, ?escape_ascii: bool, ?code_language: String, ?autolinks: bool, ?expand_abbreviations: bool, ?include_blockquote_citations: bool, ?default_title: bool, ?br_in_tables: bool, ?compact_tables: bool, ?highlight_style: enum_HighlightStyle, ?extract_metadata: bool, ?whitespace_mode: enum_WhitespaceMode, ?strip_newlines: bool, ?wrap: bool, ?wrap_width: Integer, ?convert_as_inline: bool, ?sub_symbol: String, ?sup_symbol: String, ?newline_style: enum_NewlineStyle, ?code_block_style: enum_CodeBlockStyle, ?keep_inline_images_in: Array[String], ?preprocessing: PreprocessingOptions, ?encoding: String, ?debug: bool, ?strip_tags: Array[String], ?preserve_tags: Array[String], ?skip_images: bool, ?inline_data_media: enum_InlineDataMedia, ?hidden_content: enum_HiddenContent, ?url_escape_style: enum_UrlEscapeStyle, ?link_style: enum_LinkStyle, ?output_format: enum_OutputFormat, ?include_document_structure: bool, ?extract_images: bool, ?max_image_size: Integer, ?max_input_size: Integer, ?capture_svg: bool, ?infer_dimensions: bool, ?max_depth: Integer, ?exclude_selectors: Array[String], ?data_as_elements: Array[String], ?tier_strategy: enum_TierStrategy, ?base_url: String, ?visitor: VisitorHandle) -> void
65
66
  end
66
67
 
67
68
  class ConversionOptionsUpdate
@@ -112,11 +113,12 @@ def initialize: (?heading_style: enum_HeadingStyle, ?list_indent_type: enum_List
112
113
  attr_reader infer_dimensions: bool?
113
114
  attr_reader max_depth: Integer?
114
115
  attr_reader exclude_selectors: Array[String]?
116
+ attr_reader data_as_elements: Array[String]?
115
117
  attr_reader tier_strategy: enum_TierStrategy?
116
118
  attr_reader base_url: String?
117
119
  attr_reader visitor: VisitorHandle?
118
120
 
119
- def initialize: (?heading_style: enum_HeadingStyle, ?list_indent_type: enum_ListIndentType, ?list_indent_width: Integer, ?bullets: String, ?strong_em_symbol: String, ?escape_asterisks: bool, ?escape_underscores: bool, ?escape_misc: bool, ?escape_ascii: bool, ?code_language: String, ?autolinks: bool, ?expand_abbreviations: bool, ?include_blockquote_citations: bool, ?default_title: bool, ?br_in_tables: bool, ?compact_tables: bool, ?highlight_style: enum_HighlightStyle, ?extract_metadata: bool, ?whitespace_mode: enum_WhitespaceMode, ?strip_newlines: bool, ?wrap: bool, ?wrap_width: Integer, ?convert_as_inline: bool, ?sub_symbol: String, ?sup_symbol: String, ?newline_style: enum_NewlineStyle, ?code_block_style: enum_CodeBlockStyle, ?keep_inline_images_in: Array[String], ?preprocessing: PreprocessingOptionsUpdate, ?encoding: String, ?debug: bool, ?strip_tags: Array[String], ?preserve_tags: Array[String], ?skip_images: bool, ?inline_data_media: enum_InlineDataMedia, ?hidden_content: enum_HiddenContent, ?url_escape_style: enum_UrlEscapeStyle, ?link_style: enum_LinkStyle, ?output_format: enum_OutputFormat, ?include_document_structure: bool, ?extract_images: bool, ?max_image_size: Integer, ?max_input_size: Integer?, ?capture_svg: bool, ?infer_dimensions: bool, ?max_depth: Integer?, ?exclude_selectors: Array[String], ?tier_strategy: enum_TierStrategy, ?base_url: String?, ?visitor: VisitorHandle) -> void
121
+ def initialize: (?heading_style: enum_HeadingStyle, ?list_indent_type: enum_ListIndentType, ?list_indent_width: Integer, ?bullets: String, ?strong_em_symbol: String, ?escape_asterisks: bool, ?escape_underscores: bool, ?escape_misc: bool, ?escape_ascii: bool, ?code_language: String, ?autolinks: bool, ?expand_abbreviations: bool, ?include_blockquote_citations: bool, ?default_title: bool, ?br_in_tables: bool, ?compact_tables: bool, ?highlight_style: enum_HighlightStyle, ?extract_metadata: bool, ?whitespace_mode: enum_WhitespaceMode, ?strip_newlines: bool, ?wrap: bool, ?wrap_width: Integer, ?convert_as_inline: bool, ?sub_symbol: String, ?sup_symbol: String, ?newline_style: enum_NewlineStyle, ?code_block_style: enum_CodeBlockStyle, ?keep_inline_images_in: Array[String], ?preprocessing: PreprocessingOptionsUpdate, ?encoding: String, ?debug: bool, ?strip_tags: Array[String], ?preserve_tags: Array[String], ?skip_images: bool, ?inline_data_media: enum_InlineDataMedia, ?hidden_content: enum_HiddenContent, ?url_escape_style: enum_UrlEscapeStyle, ?link_style: enum_LinkStyle, ?output_format: enum_OutputFormat, ?include_document_structure: bool, ?extract_images: bool, ?max_image_size: Integer, ?max_input_size: Integer?, ?capture_svg: bool, ?infer_dimensions: bool, ?max_depth: Integer?, ?exclude_selectors: Array[String], ?data_as_elements: Array[String], ?tier_strategy: enum_TierStrategy, ?base_url: String?, ?visitor: VisitorHandle) -> void
120
122
  end
121
123
 
122
124
  class ConversionResult
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.22.2
4
+ version: 3.23.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-11-15 00:00:00.000000000 Z
12
+ date: 2026-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb_sys