html-to-markdown 3.18.7 → 3.19.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: e175db6704b5a4ac22e317895b4314dff1dbc809ed724da74ddc664b1edfeeb6
4
- data.tar.gz: ca4ce9c464f60b9150bc7d508b5310841b08f6bef99218dbb2635a7a6b19bc89
3
+ metadata.gz: e42d1e5a9c4cab13d5840556d5e6a518aa98576495b6fe08cf376a93392d8ba5
4
+ data.tar.gz: 7e20b6da6705d9bcf643ee55dccd5b0de4131b170236c2bf9785eed5dd048133
5
5
  SHA512:
6
- metadata.gz: 8a7a0b77e588a87d4f65e277c7a8408724f396c567171314ce13a9c44f5e20a5b7455f10f0c21c8037af138a6b1797604d5ac742e7f8f044139246c37bbf9a81
7
- data.tar.gz: c55d9cdace13731aa4aad7c9656b6d0a56b831949ef2c5937adbdca64ae77ac9e72161c2d4bf41c98b2f6ae626e8b42cee92d4369cf63f1f08a09f822b7b07d8
6
+ metadata.gz: 9510c005552e50c8397a8db398cc8f63e5d57dbd5ca889c96077019d2db9f60f63fd1a14a234d3836752aedae0620919a07d6c90b8bf5fce5dbded58c0d49f1a
7
+ data.tar.gz: a79521d8aa524eb9261167d71fd56a1fffa31ec7a1f2a4458ba3076d968d1361f18b96ca5f907d596120f0ad84e743ecd2e1d62f78f0582af1dd3b523845fb6c
@@ -252,7 +252,7 @@ checksum = "491194d601b4fa9fac3c9571e014070a0ad1bc3392d1bc10419695196a8b3cc3"
252
252
 
253
253
  [[package]]
254
254
  name = "html-to-markdown-rb"
255
- version = "3.18.7"
255
+ version = "3.19.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.18.7"
269
+ version = "3.19.0"
270
270
  source = "registry+https://github.com/rust-lang/crates.io-index"
271
- checksum = "259eff8de02b67e436fa4ccd377dbf6105d530fc405f20489677f417cf673a7a"
271
+ checksum = "ddada45be32a036999fbda2be5df286dc2001816e60099ec3fd445fc6c3bb69b"
272
272
  dependencies = [
273
273
  "ahash",
274
274
  "astral-tl",
@@ -1,11 +1,11 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:ada94196b1eb7453e4131fa267514d382755d55a82cd30bd90db1323ab8c9fbc
2
+ # alef:hash:fa3a53f518517843e506e230f22cd23c0afd1bcead1c05e1f1d17a72039f3f7d
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.18.7"
8
+ version = "3.19.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.18.7", features = ["serde", "metadata", "visitor", "inline-images", "testkit"] }
34
+ html-to-markdown-rs = { version = "3.19.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:71422c48948c3ed5a6716f00e2d54cb32804161fd701c7c7549a6fcf652e6bf5
2
+ // alef:hash:4b8dded025d0cab583492c692b2a248f959abe1e38e464768e056b4624f1bb5e
3
3
  // Re-generate with: alef generate
4
4
  #![allow(dead_code, unused_imports, unused_variables)]
5
5
  #![allow(
@@ -97,7 +97,6 @@ pub struct ConversionOptions {
97
97
  preserve_tags: Vec<String>,
98
98
  skip_images: bool,
99
99
  inline_data_media: InlineDataMedia,
100
- use_accessible_names: bool,
101
100
  hidden_content: HiddenContent,
102
101
  url_escape_style: UrlEscapeStyle,
103
102
  link_style: LinkStyle,
@@ -470,15 +469,6 @@ impl ConversionOptions {
470
469
  })?,
471
470
  None => InlineDataMedia::Keep,
472
471
  },
473
- use_accessible_names: match kwargs.get(ruby.to_symbol("use_accessible_names")) {
474
- Some(v) => bool::try_convert(v).map_err(|e| {
475
- magnus::Error::new(
476
- unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
477
- format!("invalid value for `use_accessible_names`: {}", e),
478
- )
479
- })?,
480
- None => true,
481
- },
482
472
  hidden_content: match kwargs.get(ruby.to_symbol("hidden_content")) {
483
473
  Some(v) => HiddenContent::try_convert(v).map_err(|e| {
484
474
  magnus::Error::new(
@@ -748,10 +738,6 @@ impl ConversionOptions {
748
738
  self.inline_data_media.clone()
749
739
  }
750
740
 
751
- fn use_accessible_names(&self) -> bool {
752
- self.use_accessible_names
753
- }
754
-
755
741
  fn hidden_content(&self) -> HiddenContent {
756
742
  self.hidden_content.clone()
757
743
  }
@@ -848,7 +834,6 @@ pub struct ConversionOptionsUpdate {
848
834
  preserve_tags: Option<Vec<String>>,
849
835
  skip_images: Option<bool>,
850
836
  inline_data_media: Option<InlineDataMedia>,
851
- use_accessible_names: Option<bool>,
852
837
  hidden_content: Option<HiddenContent>,
853
838
  url_escape_style: Option<UrlEscapeStyle>,
854
839
  link_style: Option<LinkStyle>,
@@ -1230,18 +1215,6 @@ impl ConversionOptionsUpdate {
1230
1215
  })?),
1231
1216
  None => None,
1232
1217
  },
1233
- use_accessible_names: match kwargs
1234
- .get(ruby.to_symbol("use_accessible_names"))
1235
- .filter(|v| !v.is_nil())
1236
- {
1237
- Some(v) => Some(bool::try_convert(v).map_err(|e| {
1238
- magnus::Error::new(
1239
- unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
1240
- format!("invalid value for `use_accessible_names`: {}", e),
1241
- )
1242
- })?),
1243
- None => None,
1244
- },
1245
1218
  hidden_content: match kwargs.get(ruby.to_symbol("hidden_content")).filter(|v| !v.is_nil()) {
1246
1219
  Some(v) => Some(HiddenContent::try_convert(v).map_err(|e| {
1247
1220
  magnus::Error::new(
@@ -1514,10 +1487,6 @@ impl ConversionOptionsUpdate {
1514
1487
  self.inline_data_media.clone()
1515
1488
  }
1516
1489
 
1517
- fn use_accessible_names(&self) -> Option<bool> {
1518
- self.use_accessible_names
1519
- }
1520
-
1521
1490
  fn hidden_content(&self) -> Option<HiddenContent> {
1522
1491
  self.hidden_content.clone()
1523
1492
  }
@@ -5377,6 +5346,56 @@ pub fn convert(args: &[magnus::Value]) -> Result<ConversionResult, Error> {
5377
5346
  })
5378
5347
  }
5379
5348
 
5349
+ #[allow(clippy::missing_errors_doc)]
5350
+ #[allow(unused_variables)]
5351
+ pub fn convert_with_accessible_names(args: &[magnus::Value]) -> Result<ConversionResult, Error> {
5352
+ let args = magnus::scan_args::scan_args::<(String, bool), (Option<magnus::Value>,), (), (), (), ()>(args)?;
5353
+ let (html, use_accessible_names) = args.required;
5354
+ let (visitor,) = args.optional;
5355
+ let options_core = match visitor {
5356
+ Some(v) if !v.is_nil() => {
5357
+ if magnus::RHash::from_value(v).is_some() {
5358
+ let json = v.funcall::<_, _, String>("to_json", ()).map_err(|e| {
5359
+ magnus::Error::new(
5360
+ unsafe { magnus::Ruby::get_unchecked() }.exception_runtime_error(),
5361
+ format!("failed to serialize Ruby options to JSON: {}", e),
5362
+ )
5363
+ })?;
5364
+ serde_json::from_str::<html_to_markdown_rs::ConversionOptions>(&json).map_err(|e| {
5365
+ magnus::Error::new(
5366
+ unsafe { magnus::Ruby::get_unchecked() }.exception_runtime_error(),
5367
+ format!("failed to deserialize options JSON: {}", e),
5368
+ )
5369
+ })?
5370
+ } else if let Ok(opts_binding) = <&ConversionOptions as magnus::TryConvert>::try_convert(v) {
5371
+ opts_binding.clone().into()
5372
+ } else {
5373
+ let bridge = RbHtmlVisitorBridge::new(v, String::new())?;
5374
+ let handle = std::sync::Arc::new(std::sync::Mutex::new(bridge)) as html_to_markdown_rs::VisitorHandle;
5375
+ #[allow(
5376
+ clippy::field_reassign_with_default,
5377
+ reason = "External options may be non-exhaustive or contain private fields"
5378
+ )]
5379
+ {
5380
+ let mut opts = html_to_markdown_rs::ConversionOptions::default();
5381
+ opts.visitor = Some(handle);
5382
+ opts
5383
+ }
5384
+ }
5385
+ }
5386
+ _ => html_to_markdown_rs::ConversionOptions::default(),
5387
+ };
5388
+
5389
+ html_to_markdown_rs::convert_with_accessible_names(&html, use_accessible_names, Some(options_core))
5390
+ .map(|val| val.into())
5391
+ .map_err(|e| {
5392
+ magnus::Error::new(
5393
+ unsafe { magnus::Ruby::get_unchecked() }.exception_runtime_error(),
5394
+ e.to_string(),
5395
+ )
5396
+ })
5397
+ }
5398
+
5380
5399
  fn nodecontext_to_rb_hash(ctx: &html_to_markdown_rs::NodeContext) -> magnus::RHash {
5381
5400
  let ruby = unsafe { magnus::Ruby::get_unchecked() };
5382
5401
  let h = ruby.hash_new();
@@ -7101,7 +7120,6 @@ impl From<ConversionOptions> for html_to_markdown_rs::options::ConversionOptions
7101
7120
  preserve_tags: val.preserve_tags.into_iter().collect(),
7102
7121
  skip_images: val.skip_images,
7103
7122
  inline_data_media: val.inline_data_media.into(),
7104
- use_accessible_names: val.use_accessible_names,
7105
7123
  hidden_content: val.hidden_content.into(),
7106
7124
  url_escape_style: val.url_escape_style.into(),
7107
7125
  link_style: val.link_style.into(),
@@ -7160,7 +7178,6 @@ impl From<html_to_markdown_rs::options::ConversionOptions> for ConversionOptions
7160
7178
  preserve_tags: val.preserve_tags.into_iter().collect(),
7161
7179
  skip_images: val.skip_images,
7162
7180
  inline_data_media: val.inline_data_media.into(),
7163
- use_accessible_names: val.use_accessible_names,
7164
7181
  hidden_content: val.hidden_content.into(),
7165
7182
  url_escape_style: val.url_escape_style.into(),
7166
7183
  link_style: val.link_style.into(),
@@ -7218,7 +7235,6 @@ impl From<html_to_markdown_rs::options::ConversionOptionsUpdate> for ConversionO
7218
7235
  preserve_tags: val.preserve_tags.map(|v| v.into_iter().collect()),
7219
7236
  skip_images: val.skip_images,
7220
7237
  inline_data_media: val.inline_data_media.map(Into::into),
7221
- use_accessible_names: val.use_accessible_names,
7222
7238
  hidden_content: val.hidden_content.map(Into::into),
7223
7239
  url_escape_style: val.url_escape_style.map(Into::into),
7224
7240
  link_style: val.link_style.map(Into::into),
@@ -8589,11 +8605,6 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
8589
8605
 
8590
8606
  class.define_method("inline_data_media", method!(ConversionOptions::inline_data_media, 0))?;
8591
8607
 
8592
- class.define_method(
8593
- "use_accessible_names",
8594
- method!(ConversionOptions::use_accessible_names, 0),
8595
- )?;
8596
-
8597
8608
  class.define_method("hidden_content", method!(ConversionOptions::hidden_content, 0))?;
8598
8609
 
8599
8610
  class.define_method("url_escape_style", method!(ConversionOptions::url_escape_style, 0))?;
@@ -8735,11 +8746,6 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
8735
8746
  method!(ConversionOptionsUpdate::inline_data_media, 0),
8736
8747
  )?;
8737
8748
 
8738
- class.define_method(
8739
- "use_accessible_names",
8740
- method!(ConversionOptionsUpdate::use_accessible_names, 0),
8741
- )?;
8742
-
8743
8749
  class.define_method("hidden_content", method!(ConversionOptionsUpdate::hidden_content, 0))?;
8744
8750
 
8745
8751
  class.define_method(
@@ -9092,6 +9098,11 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
9092
9098
 
9093
9099
  module.define_module_function("convert", function!(convert, -1))?;
9094
9100
 
9101
+ module.define_module_function(
9102
+ "convert_with_accessible_names",
9103
+ function!(convert_with_accessible_names, -1),
9104
+ )?;
9105
+
9095
9106
  let conversion_error_class = module.define_error("ConversionError", ruby.exception_standard_error())?;
9096
9107
  let parse_error_class = module.define_error("ParseError", conversion_error_class)?;
9097
9108
  let sanitization_error_class = module.define_error("SanitizationError", conversion_error_class)?;
@@ -1,5 +1,5 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:b035df027077810826d9d805f32ef7ac142e025791c1098a52026f8500fe0fbc
2
+ # alef:hash:09a04cb502ed10072dd986b919b61b19dd89f1684de6b0ec0ad98dbc4a7f9805
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
  # frozen_string_literal: true
@@ -60,6 +60,9 @@ module HtmlToMarkdown
60
60
  define_singleton_method(:convert) { |*args, **kwargs, &blk|
61
61
  HtmlToMarkdownRs.public_send(:convert, *args, **kwargs, &blk)
62
62
  }
63
+ define_singleton_method(:convert_with_accessible_names) { |*args, **kwargs, &blk|
64
+ HtmlToMarkdownRs.public_send(:convert_with_accessible_names, *args, **kwargs, &blk)
65
+ }
63
66
  end
64
67
 
65
68
  module HtmlToMarkdown
@@ -1,10 +1,10 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:d237009ab3b656420cb26aeb135fb1cf648029444bb34a8583d36feddc02da36
2
+ # alef:hash:2af93614191f5e65ab3e6f136720482baa1b1ccd900ee7561aeb92a517ef3fe1
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.18.7"
9
+ VERSION = "3.19.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:b61c3a1ce940a4abd4e06f83687b3557a485d83d7451fad630c72b325b0def95
2
+ # alef:hash:0715469498b948fa0fede0134e676b43663986d359510ac029708f761e5dd5eb
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
 
@@ -45,7 +45,6 @@ type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Fl
45
45
  attr_reader preserve_tags: Array[String]
46
46
  attr_reader skip_images: bool
47
47
  attr_reader inline_data_media: enum_InlineDataMedia
48
- attr_reader use_accessible_names: bool
49
48
  attr_reader hidden_content: enum_HiddenContent
50
49
  attr_reader url_escape_style: enum_UrlEscapeStyle
51
50
  attr_reader link_style: enum_LinkStyle
@@ -62,7 +61,7 @@ type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Fl
62
61
  attr_reader base_url: String?
63
62
  attr_reader visitor: VisitorHandle?
64
63
 
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, ?use_accessible_names: bool, ?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
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
66
65
  end
67
66
 
68
67
  class ConversionOptionsUpdate
@@ -101,7 +100,6 @@ def initialize: (?heading_style: enum_HeadingStyle, ?list_indent_type: enum_List
101
100
  attr_reader preserve_tags: Array[String]?
102
101
  attr_reader skip_images: bool?
103
102
  attr_reader inline_data_media: enum_InlineDataMedia?
104
- attr_reader use_accessible_names: bool?
105
103
  attr_reader hidden_content: enum_HiddenContent?
106
104
  attr_reader url_escape_style: enum_UrlEscapeStyle?
107
105
  attr_reader link_style: enum_LinkStyle?
@@ -118,7 +116,7 @@ def initialize: (?heading_style: enum_HeadingStyle, ?list_indent_type: enum_List
118
116
  attr_reader base_url: String?
119
117
  attr_reader visitor: VisitorHandle?
120
118
 
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, ?use_accessible_names: bool, ?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
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
122
120
  end
123
121
 
124
122
  class ConversionResult
@@ -305,7 +303,155 @@ def initialize: (?rows: Integer, ?cols: Integer, ?cells: Array[GridCell]) -> voi
305
303
  class VisitorHandle
306
304
  end
307
305
 
308
- class AnnotationKind
306
+ module AnnotationKind
307
+ def self.from_hash: (untyped hash) -> untyped
308
+ end
309
+
310
+ class AnnotationKindBold
311
+ include AnnotationKind
312
+ def bold?: () -> bool
313
+ def italic?: () -> bool
314
+ def underline?: () -> bool
315
+ def strikethrough?: () -> bool
316
+ def code?: () -> bool
317
+ def subscript?: () -> bool
318
+ def superscript?: () -> bool
319
+ def highlight?: () -> bool
320
+ def link?: () -> bool
321
+
322
+ def self.from_hash: (untyped hash) -> untyped
323
+ def self.new: -> AnnotationKindBold
324
+ end
325
+
326
+ class AnnotationKindItalic
327
+ include AnnotationKind
328
+ def bold?: () -> bool
329
+ def italic?: () -> bool
330
+ def underline?: () -> bool
331
+ def strikethrough?: () -> bool
332
+ def code?: () -> bool
333
+ def subscript?: () -> bool
334
+ def superscript?: () -> bool
335
+ def highlight?: () -> bool
336
+ def link?: () -> bool
337
+
338
+ def self.from_hash: (untyped hash) -> untyped
339
+ def self.new: -> AnnotationKindItalic
340
+ end
341
+
342
+ class AnnotationKindUnderline
343
+ include AnnotationKind
344
+ def bold?: () -> bool
345
+ def italic?: () -> bool
346
+ def underline?: () -> bool
347
+ def strikethrough?: () -> bool
348
+ def code?: () -> bool
349
+ def subscript?: () -> bool
350
+ def superscript?: () -> bool
351
+ def highlight?: () -> bool
352
+ def link?: () -> bool
353
+
354
+ def self.from_hash: (untyped hash) -> untyped
355
+ def self.new: -> AnnotationKindUnderline
356
+ end
357
+
358
+ class AnnotationKindStrikethrough
359
+ include AnnotationKind
360
+ def bold?: () -> bool
361
+ def italic?: () -> bool
362
+ def underline?: () -> bool
363
+ def strikethrough?: () -> bool
364
+ def code?: () -> bool
365
+ def subscript?: () -> bool
366
+ def superscript?: () -> bool
367
+ def highlight?: () -> bool
368
+ def link?: () -> bool
369
+
370
+ def self.from_hash: (untyped hash) -> untyped
371
+ def self.new: -> AnnotationKindStrikethrough
372
+ end
373
+
374
+ class AnnotationKindCode
375
+ include AnnotationKind
376
+ def bold?: () -> bool
377
+ def italic?: () -> bool
378
+ def underline?: () -> bool
379
+ def strikethrough?: () -> bool
380
+ def code?: () -> bool
381
+ def subscript?: () -> bool
382
+ def superscript?: () -> bool
383
+ def highlight?: () -> bool
384
+ def link?: () -> bool
385
+
386
+ def self.from_hash: (untyped hash) -> untyped
387
+ def self.new: -> AnnotationKindCode
388
+ end
389
+
390
+ class AnnotationKindSubscript
391
+ include AnnotationKind
392
+ def bold?: () -> bool
393
+ def italic?: () -> bool
394
+ def underline?: () -> bool
395
+ def strikethrough?: () -> bool
396
+ def code?: () -> bool
397
+ def subscript?: () -> bool
398
+ def superscript?: () -> bool
399
+ def highlight?: () -> bool
400
+ def link?: () -> bool
401
+
402
+ def self.from_hash: (untyped hash) -> untyped
403
+ def self.new: -> AnnotationKindSubscript
404
+ end
405
+
406
+ class AnnotationKindSuperscript
407
+ include AnnotationKind
408
+ def bold?: () -> bool
409
+ def italic?: () -> bool
410
+ def underline?: () -> bool
411
+ def strikethrough?: () -> bool
412
+ def code?: () -> bool
413
+ def subscript?: () -> bool
414
+ def superscript?: () -> bool
415
+ def highlight?: () -> bool
416
+ def link?: () -> bool
417
+
418
+ def self.from_hash: (untyped hash) -> untyped
419
+ def self.new: -> AnnotationKindSuperscript
420
+ end
421
+
422
+ class AnnotationKindHighlight
423
+ include AnnotationKind
424
+ def bold?: () -> bool
425
+ def italic?: () -> bool
426
+ def underline?: () -> bool
427
+ def strikethrough?: () -> bool
428
+ def code?: () -> bool
429
+ def subscript?: () -> bool
430
+ def superscript?: () -> bool
431
+ def highlight?: () -> bool
432
+ def link?: () -> bool
433
+
434
+ def self.from_hash: (untyped hash) -> untyped
435
+ def self.new: -> AnnotationKindHighlight
436
+ end
437
+
438
+ class AnnotationKindLink
439
+ include AnnotationKind
440
+ attr_reader url: String
441
+ attr_reader title: String?
442
+
443
+ def bold?: () -> bool
444
+ def italic?: () -> bool
445
+ def underline?: () -> bool
446
+ def strikethrough?: () -> bool
447
+ def code?: () -> bool
448
+ def subscript?: () -> bool
449
+ def superscript?: () -> bool
450
+ def highlight?: () -> bool
451
+ def link?: () -> bool
452
+
453
+ def self.from_hash: (untyped hash) -> untyped
454
+ def self.new: (url: String, title: String) -> AnnotationKindLink
309
455
  end
310
456
 
311
457
  type enum_CodeBlockStyle = :Indented | :Backticks | :Tildes
@@ -328,7 +474,298 @@ def initialize: (?rows: Integer, ?cols: Integer, ?cells: Array[GridCell]) -> voi
328
474
 
329
475
  type enum_NewlineStyle = :Spaces | :Backslash
330
476
 
331
- class NodeContent
477
+ module NodeContent
478
+ def self.from_hash: (untyped hash) -> untyped
479
+ end
480
+
481
+ class NodeContentHeading
482
+ include NodeContent
483
+ attr_reader level: Integer
484
+ attr_reader text: String
485
+
486
+ def heading?: () -> bool
487
+ def paragraph?: () -> bool
488
+ def list?: () -> bool
489
+ def list_item?: () -> bool
490
+ def table?: () -> bool
491
+ def image?: () -> bool
492
+ def code?: () -> bool
493
+ def quote?: () -> bool
494
+ def definition_list?: () -> bool
495
+ def definition_item?: () -> bool
496
+ def raw_block?: () -> bool
497
+ def metadata_block?: () -> bool
498
+ def group?: () -> bool
499
+
500
+ def self.from_hash: (untyped hash) -> untyped
501
+ def self.new: (level: Integer, text: String) -> NodeContentHeading
502
+ end
503
+
504
+ class NodeContentParagraph
505
+ include NodeContent
506
+ attr_reader text: String
507
+
508
+ def heading?: () -> bool
509
+ def paragraph?: () -> bool
510
+ def list?: () -> bool
511
+ def list_item?: () -> bool
512
+ def table?: () -> bool
513
+ def image?: () -> bool
514
+ def code?: () -> bool
515
+ def quote?: () -> bool
516
+ def definition_list?: () -> bool
517
+ def definition_item?: () -> bool
518
+ def raw_block?: () -> bool
519
+ def metadata_block?: () -> bool
520
+ def group?: () -> bool
521
+
522
+ def self.from_hash: (untyped hash) -> untyped
523
+ def self.new: (text: String) -> NodeContentParagraph
524
+ end
525
+
526
+ class NodeContentList
527
+ include NodeContent
528
+ attr_reader ordered: bool
529
+
530
+ def heading?: () -> bool
531
+ def paragraph?: () -> bool
532
+ def list?: () -> bool
533
+ def list_item?: () -> bool
534
+ def table?: () -> bool
535
+ def image?: () -> bool
536
+ def code?: () -> bool
537
+ def quote?: () -> bool
538
+ def definition_list?: () -> bool
539
+ def definition_item?: () -> bool
540
+ def raw_block?: () -> bool
541
+ def metadata_block?: () -> bool
542
+ def group?: () -> bool
543
+
544
+ def self.from_hash: (untyped hash) -> untyped
545
+ def self.new: (ordered: bool) -> NodeContentList
546
+ end
547
+
548
+ class NodeContentListItem
549
+ include NodeContent
550
+ attr_reader text: String
551
+
552
+ def heading?: () -> bool
553
+ def paragraph?: () -> bool
554
+ def list?: () -> bool
555
+ def list_item?: () -> bool
556
+ def table?: () -> bool
557
+ def image?: () -> bool
558
+ def code?: () -> bool
559
+ def quote?: () -> bool
560
+ def definition_list?: () -> bool
561
+ def definition_item?: () -> bool
562
+ def raw_block?: () -> bool
563
+ def metadata_block?: () -> bool
564
+ def group?: () -> bool
565
+
566
+ def self.from_hash: (untyped hash) -> untyped
567
+ def self.new: (text: String) -> NodeContentListItem
568
+ end
569
+
570
+ class NodeContentTable
571
+ include NodeContent
572
+ attr_reader grid: TableGrid
573
+
574
+ def heading?: () -> bool
575
+ def paragraph?: () -> bool
576
+ def list?: () -> bool
577
+ def list_item?: () -> bool
578
+ def table?: () -> bool
579
+ def image?: () -> bool
580
+ def code?: () -> bool
581
+ def quote?: () -> bool
582
+ def definition_list?: () -> bool
583
+ def definition_item?: () -> bool
584
+ def raw_block?: () -> bool
585
+ def metadata_block?: () -> bool
586
+ def group?: () -> bool
587
+
588
+ def self.from_hash: (untyped hash) -> untyped
589
+ def self.new: (grid: TableGrid) -> NodeContentTable
590
+ end
591
+
592
+ class NodeContentImage
593
+ include NodeContent
594
+ attr_reader description: String?
595
+ attr_reader src: String?
596
+ attr_reader image_index: Integer?
597
+
598
+ def heading?: () -> bool
599
+ def paragraph?: () -> bool
600
+ def list?: () -> bool
601
+ def list_item?: () -> bool
602
+ def table?: () -> bool
603
+ def image?: () -> bool
604
+ def code?: () -> bool
605
+ def quote?: () -> bool
606
+ def definition_list?: () -> bool
607
+ def definition_item?: () -> bool
608
+ def raw_block?: () -> bool
609
+ def metadata_block?: () -> bool
610
+ def group?: () -> bool
611
+
612
+ def self.from_hash: (untyped hash) -> untyped
613
+ def self.new: (description: String, src: String, image_index: Integer) -> NodeContentImage
614
+ end
615
+
616
+ class NodeContentCode
617
+ include NodeContent
618
+ attr_reader text: String
619
+ attr_reader language: String?
620
+
621
+ def heading?: () -> bool
622
+ def paragraph?: () -> bool
623
+ def list?: () -> bool
624
+ def list_item?: () -> bool
625
+ def table?: () -> bool
626
+ def image?: () -> bool
627
+ def code?: () -> bool
628
+ def quote?: () -> bool
629
+ def definition_list?: () -> bool
630
+ def definition_item?: () -> bool
631
+ def raw_block?: () -> bool
632
+ def metadata_block?: () -> bool
633
+ def group?: () -> bool
634
+
635
+ def self.from_hash: (untyped hash) -> untyped
636
+ def self.new: (text: String, language: String) -> NodeContentCode
637
+ end
638
+
639
+ class NodeContentQuote
640
+ include NodeContent
641
+ def heading?: () -> bool
642
+ def paragraph?: () -> bool
643
+ def list?: () -> bool
644
+ def list_item?: () -> bool
645
+ def table?: () -> bool
646
+ def image?: () -> bool
647
+ def code?: () -> bool
648
+ def quote?: () -> bool
649
+ def definition_list?: () -> bool
650
+ def definition_item?: () -> bool
651
+ def raw_block?: () -> bool
652
+ def metadata_block?: () -> bool
653
+ def group?: () -> bool
654
+
655
+ def self.from_hash: (untyped hash) -> untyped
656
+ def self.new: -> NodeContentQuote
657
+ end
658
+
659
+ class NodeContentDefinitionList
660
+ include NodeContent
661
+ def heading?: () -> bool
662
+ def paragraph?: () -> bool
663
+ def list?: () -> bool
664
+ def list_item?: () -> bool
665
+ def table?: () -> bool
666
+ def image?: () -> bool
667
+ def code?: () -> bool
668
+ def quote?: () -> bool
669
+ def definition_list?: () -> bool
670
+ def definition_item?: () -> bool
671
+ def raw_block?: () -> bool
672
+ def metadata_block?: () -> bool
673
+ def group?: () -> bool
674
+
675
+ def self.from_hash: (untyped hash) -> untyped
676
+ def self.new: -> NodeContentDefinitionList
677
+ end
678
+
679
+ class NodeContentDefinitionItem
680
+ include NodeContent
681
+ attr_reader term: String
682
+ attr_reader definition: String
683
+
684
+ def heading?: () -> bool
685
+ def paragraph?: () -> bool
686
+ def list?: () -> bool
687
+ def list_item?: () -> bool
688
+ def table?: () -> bool
689
+ def image?: () -> bool
690
+ def code?: () -> bool
691
+ def quote?: () -> bool
692
+ def definition_list?: () -> bool
693
+ def definition_item?: () -> bool
694
+ def raw_block?: () -> bool
695
+ def metadata_block?: () -> bool
696
+ def group?: () -> bool
697
+
698
+ def self.from_hash: (untyped hash) -> untyped
699
+ def self.new: (term: String, definition: String) -> NodeContentDefinitionItem
700
+ end
701
+
702
+ class NodeContentRawBlock
703
+ include NodeContent
704
+ attr_reader format: String
705
+ attr_reader content: String
706
+
707
+ def heading?: () -> bool
708
+ def paragraph?: () -> bool
709
+ def list?: () -> bool
710
+ def list_item?: () -> bool
711
+ def table?: () -> bool
712
+ def image?: () -> bool
713
+ def code?: () -> bool
714
+ def quote?: () -> bool
715
+ def definition_list?: () -> bool
716
+ def definition_item?: () -> bool
717
+ def raw_block?: () -> bool
718
+ def metadata_block?: () -> bool
719
+ def group?: () -> bool
720
+
721
+ def self.from_hash: (untyped hash) -> untyped
722
+ def self.new: (format: String, content: String) -> NodeContentRawBlock
723
+ end
724
+
725
+ class NodeContentMetadataBlock
726
+ include NodeContent
727
+ attr_reader entries: Array[MetadataEntry]
728
+
729
+ def heading?: () -> bool
730
+ def paragraph?: () -> bool
731
+ def list?: () -> bool
732
+ def list_item?: () -> bool
733
+ def table?: () -> bool
734
+ def image?: () -> bool
735
+ def code?: () -> bool
736
+ def quote?: () -> bool
737
+ def definition_list?: () -> bool
738
+ def definition_item?: () -> bool
739
+ def raw_block?: () -> bool
740
+ def metadata_block?: () -> bool
741
+ def group?: () -> bool
742
+
743
+ def self.from_hash: (untyped hash) -> untyped
744
+ def self.new: (entries: Array[MetadataEntry]) -> NodeContentMetadataBlock
745
+ end
746
+
747
+ class NodeContentGroup
748
+ include NodeContent
749
+ attr_reader label: String?
750
+ attr_reader heading_level: Integer?
751
+ attr_reader heading_text: String?
752
+
753
+ def heading?: () -> bool
754
+ def paragraph?: () -> bool
755
+ def list?: () -> bool
756
+ def list_item?: () -> bool
757
+ def table?: () -> bool
758
+ def image?: () -> bool
759
+ def code?: () -> bool
760
+ def quote?: () -> bool
761
+ def definition_list?: () -> bool
762
+ def definition_item?: () -> bool
763
+ def raw_block?: () -> bool
764
+ def metadata_block?: () -> bool
765
+ def group?: () -> bool
766
+
767
+ def self.from_hash: (untyped hash) -> untyped
768
+ def self.new: (label: String, heading_level: Integer, heading_text: String) -> NodeContentGroup
332
769
  end
333
770
 
334
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
@@ -345,7 +782,72 @@ def initialize: (?rows: Integer, ?cols: Integer, ?cells: Array[GridCell]) -> voi
345
782
 
346
783
  type enum_UrlEscapeStyle = :Angle | :Percent
347
784
 
348
- class VisitResult
785
+ module VisitResult
786
+ def self.from_hash: (untyped hash) -> untyped
787
+ end
788
+
789
+ class VisitResultContinue
790
+ include VisitResult
791
+ def continue?: () -> bool
792
+ def custom?: () -> bool
793
+ def skip?: () -> bool
794
+ def preserve_html?: () -> bool
795
+ def error?: () -> bool
796
+
797
+ def self.from_hash: (untyped hash) -> untyped
798
+ def self.new: -> VisitResultContinue
799
+ end
800
+
801
+ class VisitResultCustom
802
+ include VisitResult
803
+ attr_reader value: String
804
+
805
+ def continue?: () -> bool
806
+ def custom?: () -> bool
807
+ def skip?: () -> bool
808
+ def preserve_html?: () -> bool
809
+ def error?: () -> bool
810
+
811
+ def self.from_hash: (untyped hash) -> untyped
812
+ def self.new: (value: String) -> VisitResultCustom
813
+ end
814
+
815
+ class VisitResultSkip
816
+ include VisitResult
817
+ def continue?: () -> bool
818
+ def custom?: () -> bool
819
+ def skip?: () -> bool
820
+ def preserve_html?: () -> bool
821
+ def error?: () -> bool
822
+
823
+ def self.from_hash: (untyped hash) -> untyped
824
+ def self.new: -> VisitResultSkip
825
+ end
826
+
827
+ class VisitResultPreserveHtml
828
+ include VisitResult
829
+ def continue?: () -> bool
830
+ def custom?: () -> bool
831
+ def skip?: () -> bool
832
+ def preserve_html?: () -> bool
833
+ def error?: () -> bool
834
+
835
+ def self.from_hash: (untyped hash) -> untyped
836
+ def self.new: -> VisitResultPreserveHtml
837
+ end
838
+
839
+ class VisitResultError
840
+ include VisitResult
841
+ attr_reader value: String
842
+
843
+ def continue?: () -> bool
844
+ def custom?: () -> bool
845
+ def skip?: () -> bool
846
+ def preserve_html?: () -> bool
847
+ def error?: () -> bool
848
+
849
+ def self.from_hash: (untyped hash) -> untyped
850
+ def self.new: (value: String) -> VisitResultError
349
851
  end
350
852
 
351
853
  type enum_WarningKind = :image_extraction_failed | :encoding_fallback | :truncated_input | :malformed_html | :sanitization_applied | :depth_limit_exceeded
@@ -354,6 +856,8 @@ def initialize: (?rows: Integer, ?cols: Integer, ?cells: Array[GridCell]) -> voi
354
856
 
355
857
  def self.convert: (String html, ?ConversionOptions options) -> ConversionResult
356
858
 
859
+ def self.convert_with_accessible_names: (String html, bool use_accessible_names, ?ConversionOptions options) -> ConversionResult
860
+
357
861
  interface _HtmlVisitor
358
862
  # Optional methods the bridge calls when the object defines them (the
359
863
  # trait's Rust default behavior applies otherwise): visit_text, visit_element_start, visit_element_end, visit_link, visit_image, visit_heading, visit_code_block, visit_code_inline, visit_list_item, visit_list_start, visit_list_end, visit_table_start, visit_table_row, visit_table_end, visit_blockquote, visit_strong, visit_emphasis, visit_strikethrough, visit_underline, visit_subscript, visit_superscript, visit_mark, visit_line_break, visit_horizontal_rule, visit_custom_element, visit_definition_list_start, visit_definition_term, visit_definition_description, visit_definition_list_end, visit_form, visit_input, visit_button, visit_audio, visit_video, visit_iframe, visit_details, visit_summary, visit_figure_start, visit_figcaption, visit_figure_end.
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.18.7
4
+ version: 3.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Na'aman Hirschfeld