html-to-markdown 3.14.3 → 3.15.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.
@@ -1,5 +1,5 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:7f448ade00fa6e1dcd5c3b2dfa253c426c9ec3d6127d00401c8062c30a133b7d
2
+ # alef:hash:b035df027077810826d9d805f32ef7ac142e025791c1098a52026f8500fe0fbc
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
  # frozen_string_literal: true
@@ -354,15 +354,13 @@ module HtmlToMarkdown
354
354
  # written in the source. Callers that need an absolute URL must resolve it against the
355
355
  # document base URL themselves.
356
356
  sig { returns(String) }
357
- # rubocop:disable Lint/UselessMethodDefinition
358
- def url = super
357
+ def url = Data.instance_method(:to_h).bind_call(self).fetch(:url)
359
358
  # The `title` attribute of the `<a>` element, if present.
360
359
  #
361
360
  # `None` when the `<a>` tag has no `title="..."` attribute. When present, the value
362
361
  # is copied verbatim — HTML entities within the title are not decoded.
363
362
  sig { returns(T.nilable(String)) }
364
- # rubocop:disable Lint/UselessMethodDefinition
365
- def title = super
363
+ def title = Data.instance_method(:to_h).bind_call(self).fetch(:title)
366
364
  sig { returns(T::Boolean) }
367
365
  def bold? = false
368
366
  sig { returns(T::Boolean) }
@@ -445,12 +443,10 @@ module HtmlToMarkdown
445
443
 
446
444
  # Heading level (1-6).
447
445
  sig { returns(Integer) }
448
- # rubocop:disable Lint/UselessMethodDefinition
449
- def level = super
446
+ def level = Data.instance_method(:to_h).bind_call(self).fetch(:level)
450
447
  # The heading text content.
451
448
  sig { returns(String) }
452
- # rubocop:disable Lint/UselessMethodDefinition
453
- def text = super
449
+ def text = Data.instance_method(:to_h).bind_call(self).fetch(:text)
454
450
  sig { returns(T::Boolean) }
455
451
  def heading? = true
456
452
  sig { returns(T::Boolean) }
@@ -491,8 +487,7 @@ module HtmlToMarkdown
491
487
 
492
488
  # The paragraph text content.
493
489
  sig { returns(String) }
494
- # rubocop:disable Lint/UselessMethodDefinition
495
- def text = super
490
+ def text = Data.instance_method(:to_h).bind_call(self).fetch(:text)
496
491
  sig { returns(T::Boolean) }
497
492
  def heading? = false
498
493
  sig { returns(T::Boolean) }
@@ -533,8 +528,7 @@ module HtmlToMarkdown
533
528
 
534
529
  # Whether this is an ordered list.
535
530
  sig { returns(T::Boolean) }
536
- # rubocop:disable Lint/UselessMethodDefinition
537
- def ordered = super
531
+ def ordered = Data.instance_method(:to_h).bind_call(self).fetch(:ordered)
538
532
  sig { returns(T::Boolean) }
539
533
  def heading? = false
540
534
  sig { returns(T::Boolean) }
@@ -575,8 +569,7 @@ module HtmlToMarkdown
575
569
 
576
570
  # The list item text content.
577
571
  sig { returns(String) }
578
- # rubocop:disable Lint/UselessMethodDefinition
579
- def text = super
572
+ def text = Data.instance_method(:to_h).bind_call(self).fetch(:text)
580
573
  sig { returns(T::Boolean) }
581
574
  def heading? = false
582
575
  sig { returns(T::Boolean) }
@@ -617,8 +610,7 @@ module HtmlToMarkdown
617
610
 
618
611
  # The table grid structure.
619
612
  sig { returns(TableGrid) }
620
- # rubocop:disable Lint/UselessMethodDefinition
621
- def grid = super
613
+ def grid = Data.instance_method(:to_h).bind_call(self).fetch(:grid)
622
614
  sig { returns(T::Boolean) }
623
615
  def heading? = false
624
616
  sig { returns(T::Boolean) }
@@ -659,16 +651,13 @@ module HtmlToMarkdown
659
651
 
660
652
  # Alt text or caption.
661
653
  sig { returns(T.nilable(String)) }
662
- # rubocop:disable Lint/UselessMethodDefinition
663
- def description = super
654
+ def description = Data.instance_method(:to_h).bind_call(self).fetch(:description)
664
655
  # Image source URL.
665
656
  sig { returns(T.nilable(String)) }
666
- # rubocop:disable Lint/UselessMethodDefinition
667
- def src = super
657
+ def src = Data.instance_method(:to_h).bind_call(self).fetch(:src)
668
658
  # Index into `ConversionResult.images` when image extraction is enabled.
669
659
  sig { returns(T.nilable(Integer)) }
670
- # rubocop:disable Lint/UselessMethodDefinition
671
- def image_index = super
660
+ def image_index = Data.instance_method(:to_h).bind_call(self).fetch(:image_index)
672
661
  sig { returns(T::Boolean) }
673
662
  def heading? = false
674
663
  sig { returns(T::Boolean) }
@@ -713,12 +702,10 @@ module HtmlToMarkdown
713
702
 
714
703
  # The code text content.
715
704
  sig { returns(String) }
716
- # rubocop:disable Lint/UselessMethodDefinition
717
- def text = super
705
+ def text = Data.instance_method(:to_h).bind_call(self).fetch(:text)
718
706
  # Programming language (from class="language-*" or similar).
719
707
  sig { returns(T.nilable(String)) }
720
- # rubocop:disable Lint/UselessMethodDefinition
721
- def language = super
708
+ def language = Data.instance_method(:to_h).bind_call(self).fetch(:language)
722
709
  sig { returns(T::Boolean) }
723
710
  def heading? = false
724
711
  sig { returns(T::Boolean) }
@@ -835,12 +822,10 @@ module HtmlToMarkdown
835
822
 
836
823
  # The term being defined.
837
824
  sig { returns(String) }
838
- # rubocop:disable Lint/UselessMethodDefinition
839
- def term = super
825
+ def term = Data.instance_method(:to_h).bind_call(self).fetch(:term)
840
826
  # The definition text.
841
827
  sig { returns(String) }
842
- # rubocop:disable Lint/UselessMethodDefinition
843
- def definition = super
828
+ def definition = Data.instance_method(:to_h).bind_call(self).fetch(:definition)
844
829
  sig { returns(T::Boolean) }
845
830
  def heading? = false
846
831
  sig { returns(T::Boolean) }
@@ -881,12 +866,10 @@ module HtmlToMarkdown
881
866
 
882
867
  # The format of the raw content (e.g. "html", "css", "javascript").
883
868
  sig { returns(String) }
884
- # rubocop:disable Lint/UselessMethodDefinition
885
- def format = super
869
+ def format = Data.instance_method(:to_h).bind_call(self).fetch(:format)
886
870
  # The raw content.
887
871
  sig { returns(String) }
888
- # rubocop:disable Lint/UselessMethodDefinition
889
- def content = super
872
+ def content = Data.instance_method(:to_h).bind_call(self).fetch(:content)
890
873
  sig { returns(T::Boolean) }
891
874
  def heading? = false
892
875
  sig { returns(T::Boolean) }
@@ -927,8 +910,7 @@ module HtmlToMarkdown
927
910
 
928
911
  # Key-value metadata pairs.
929
912
  sig { returns(T::Array[MetadataEntry]) }
930
- # rubocop:disable Lint/UselessMethodDefinition
931
- def entries = super
913
+ def entries = Data.instance_method(:to_h).bind_call(self).fetch(:entries)
932
914
  sig { returns(T::Boolean) }
933
915
  def heading? = false
934
916
  sig { returns(T::Boolean) }
@@ -969,16 +951,13 @@ module HtmlToMarkdown
969
951
 
970
952
  # Optional section label.
971
953
  sig { returns(T.nilable(String)) }
972
- # rubocop:disable Lint/UselessMethodDefinition
973
- def label = super
954
+ def label = Data.instance_method(:to_h).bind_call(self).fetch(:label)
974
955
  # The heading level that created this group.
975
956
  sig { returns(T.nilable(Integer)) }
976
- # rubocop:disable Lint/UselessMethodDefinition
977
- def heading_level = super
957
+ def heading_level = Data.instance_method(:to_h).bind_call(self).fetch(:heading_level)
978
958
  # The heading text that created this group.
979
959
  sig { returns(T.nilable(String)) }
980
- # rubocop:disable Lint/UselessMethodDefinition
981
- def heading_text = super
960
+ def heading_text = Data.instance_method(:to_h).bind_call(self).fetch(:heading_text)
982
961
  sig { returns(T::Boolean) }
983
962
  def heading? = false
984
963
  sig { returns(T::Boolean) }
@@ -1084,8 +1063,7 @@ module HtmlToMarkdown
1084
1063
 
1085
1064
  # @return [String]
1086
1065
  sig { returns(String) }
1087
- # rubocop:disable Lint/UselessMethodDefinition
1088
- def value = super
1066
+ def value = Data.instance_method(:to_h).bind_call(self).fetch(:value)
1089
1067
  sig { returns(T::Boolean) }
1090
1068
  def continue? = false
1091
1069
  sig { returns(T::Boolean) }
@@ -1160,8 +1138,7 @@ module HtmlToMarkdown
1160
1138
 
1161
1139
  # @return [String]
1162
1140
  sig { returns(String) }
1163
- # rubocop:disable Lint/UselessMethodDefinition
1164
- def value = super
1141
+ def value = Data.instance_method(:to_h).bind_call(self).fetch(:value)
1165
1142
  sig { returns(T::Boolean) }
1166
1143
  def continue? = false
1167
1144
  sig { returns(T::Boolean) }
@@ -1,10 +1,10 @@
1
1
  # This file is auto-generated by alef — DO NOT EDIT.
2
- # alef:hash:b177da4e55a4dfca34bce3ca158bcba69b61a921d34f68c5fadcd0e398a220ce
2
+ # alef:hash:d3db8f2a519dfe0fdc4abb8529bf0e8c4990d6581fa1a04122cce92a730c65d5
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.14.3"
9
+ VERSION = "3.15.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:5eb3a899c3b56736b875c46491ee08e8fb18b9bc638dd5f43ac0e2ce4597306b
2
+ # alef:hash:c5ae0579cda5776e922483b37b6e2a326aa2211bf97a44c9155bb8478aa502d5
3
3
  # To regenerate: alef generate
4
4
  # To verify freshness: alef verify
5
5
 
@@ -10,8 +10,8 @@ module HtmlToMarkdown
10
10
  type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Float | bool | nil
11
11
 
12
12
  class ConversionOptions
13
- attr_reader heading_style: HeadingStyle
14
- attr_reader list_indent_type: ListIndentType
13
+ attr_reader heading_style: enum_HeadingStyle
14
+ attr_reader list_indent_type: enum_ListIndentType
15
15
  attr_reader list_indent_width: Integer
16
16
  attr_reader bullets: String
17
17
  attr_reader strong_em_symbol: String
@@ -24,17 +24,17 @@ type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Fl
24
24
  attr_reader default_title: bool
25
25
  attr_reader br_in_tables: bool
26
26
  attr_reader compact_tables: bool
27
- attr_reader highlight_style: HighlightStyle
27
+ attr_reader highlight_style: enum_HighlightStyle
28
28
  attr_reader extract_metadata: bool
29
- attr_reader whitespace_mode: WhitespaceMode
29
+ attr_reader whitespace_mode: enum_WhitespaceMode
30
30
  attr_reader strip_newlines: bool
31
31
  attr_reader wrap: bool
32
32
  attr_reader wrap_width: Integer
33
33
  attr_reader convert_as_inline: bool
34
34
  attr_reader sub_symbol: String
35
35
  attr_reader sup_symbol: String
36
- attr_reader newline_style: NewlineStyle
37
- attr_reader code_block_style: CodeBlockStyle
36
+ attr_reader newline_style: enum_NewlineStyle
37
+ attr_reader code_block_style: enum_CodeBlockStyle
38
38
  attr_reader keep_inline_images_in: Array[String]
39
39
  attr_reader preprocessing: PreprocessingOptions
40
40
  attr_reader encoding: String
@@ -42,9 +42,9 @@ type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Fl
42
42
  attr_reader strip_tags: Array[String]
43
43
  attr_reader preserve_tags: Array[String]
44
44
  attr_reader skip_images: bool
45
- attr_reader url_escape_style: UrlEscapeStyle
46
- attr_reader link_style: LinkStyle
47
- attr_reader output_format: OutputFormat
45
+ attr_reader url_escape_style: enum_UrlEscapeStyle
46
+ attr_reader link_style: enum_LinkStyle
47
+ attr_reader output_format: enum_OutputFormat
48
48
  attr_reader include_document_structure: bool
49
49
  attr_reader extract_images: bool
50
50
  attr_reader max_image_size: Integer
@@ -52,15 +52,16 @@ type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Fl
52
52
  attr_reader infer_dimensions: bool
53
53
  attr_reader max_depth: Integer?
54
54
  attr_reader exclude_selectors: Array[String]
55
- attr_reader tier_strategy: TierStrategy
55
+ attr_reader tier_strategy: enum_TierStrategy
56
+ attr_reader base_url: String?
56
57
  attr_reader visitor: VisitorHandle?
57
58
 
58
- def initialize: (?heading_style: HeadingStyle, ?list_indent_type: 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, ?default_title: bool, ?br_in_tables: bool, ?compact_tables: bool, ?highlight_style: HighlightStyle, ?extract_metadata: bool, ?whitespace_mode: WhitespaceMode, ?strip_newlines: bool, ?wrap: bool, ?wrap_width: Integer, ?convert_as_inline: bool, ?sub_symbol: String, ?sup_symbol: String, ?newline_style: NewlineStyle, ?code_block_style: CodeBlockStyle, ?keep_inline_images_in: Array[String], ?preprocessing: PreprocessingOptions, ?encoding: String, ?debug: bool, ?strip_tags: Array[String], ?preserve_tags: Array[String], ?skip_images: bool, ?url_escape_style: UrlEscapeStyle, ?link_style: LinkStyle, ?output_format: OutputFormat, ?include_document_structure: bool, ?extract_images: bool, ?max_image_size: Integer, ?capture_svg: bool, ?infer_dimensions: bool, ?max_depth: Integer, ?exclude_selectors: Array[String], ?tier_strategy: TierStrategy, ?visitor: VisitorHandle) -> void
59
+ 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, ?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, ?url_escape_style: enum_UrlEscapeStyle, ?link_style: enum_LinkStyle, ?output_format: enum_OutputFormat, ?include_document_structure: bool, ?extract_images: bool, ?max_image_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
59
60
  end
60
61
 
61
62
  class ConversionOptionsUpdate
62
- attr_reader heading_style: HeadingStyle?
63
- attr_reader list_indent_type: ListIndentType?
63
+ attr_reader heading_style: enum_HeadingStyle?
64
+ attr_reader list_indent_type: enum_ListIndentType?
64
65
  attr_reader list_indent_width: Integer?
65
66
  attr_reader bullets: String?
66
67
  attr_reader strong_em_symbol: String?
@@ -73,17 +74,17 @@ def initialize: (?heading_style: HeadingStyle, ?list_indent_type: ListIndentType
73
74
  attr_reader default_title: bool?
74
75
  attr_reader br_in_tables: bool?
75
76
  attr_reader compact_tables: bool?
76
- attr_reader highlight_style: HighlightStyle?
77
+ attr_reader highlight_style: enum_HighlightStyle?
77
78
  attr_reader extract_metadata: bool?
78
- attr_reader whitespace_mode: WhitespaceMode?
79
+ attr_reader whitespace_mode: enum_WhitespaceMode?
79
80
  attr_reader strip_newlines: bool?
80
81
  attr_reader wrap: bool?
81
82
  attr_reader wrap_width: Integer?
82
83
  attr_reader convert_as_inline: bool?
83
84
  attr_reader sub_symbol: String?
84
85
  attr_reader sup_symbol: String?
85
- attr_reader newline_style: NewlineStyle?
86
- attr_reader code_block_style: CodeBlockStyle?
86
+ attr_reader newline_style: enum_NewlineStyle?
87
+ attr_reader code_block_style: enum_CodeBlockStyle?
87
88
  attr_reader keep_inline_images_in: Array[String]?
88
89
  attr_reader preprocessing: PreprocessingOptionsUpdate?
89
90
  attr_reader encoding: String?
@@ -91,9 +92,9 @@ def initialize: (?heading_style: HeadingStyle, ?list_indent_type: ListIndentType
91
92
  attr_reader strip_tags: Array[String]?
92
93
  attr_reader preserve_tags: Array[String]?
93
94
  attr_reader skip_images: bool?
94
- attr_reader url_escape_style: UrlEscapeStyle?
95
- attr_reader link_style: LinkStyle?
96
- attr_reader output_format: OutputFormat?
95
+ attr_reader url_escape_style: enum_UrlEscapeStyle?
96
+ attr_reader link_style: enum_LinkStyle?
97
+ attr_reader output_format: enum_OutputFormat?
97
98
  attr_reader include_document_structure: bool?
98
99
  attr_reader extract_images: bool?
99
100
  attr_reader max_image_size: Integer?
@@ -101,10 +102,11 @@ def initialize: (?heading_style: HeadingStyle, ?list_indent_type: ListIndentType
101
102
  attr_reader infer_dimensions: bool?
102
103
  attr_reader max_depth: Integer?
103
104
  attr_reader exclude_selectors: Array[String]?
104
- attr_reader tier_strategy: TierStrategy?
105
+ attr_reader tier_strategy: enum_TierStrategy?
106
+ attr_reader base_url: String?
105
107
  attr_reader visitor: VisitorHandle?
106
108
 
107
- def initialize: (?heading_style: HeadingStyle, ?list_indent_type: 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, ?default_title: bool, ?br_in_tables: bool, ?compact_tables: bool, ?highlight_style: HighlightStyle, ?extract_metadata: bool, ?whitespace_mode: WhitespaceMode, ?strip_newlines: bool, ?wrap: bool, ?wrap_width: Integer, ?convert_as_inline: bool, ?sub_symbol: String, ?sup_symbol: String, ?newline_style: NewlineStyle, ?code_block_style: CodeBlockStyle, ?keep_inline_images_in: Array[String], ?preprocessing: PreprocessingOptionsUpdate, ?encoding: String, ?debug: bool, ?strip_tags: Array[String], ?preserve_tags: Array[String], ?skip_images: bool, ?url_escape_style: UrlEscapeStyle, ?link_style: LinkStyle, ?output_format: OutputFormat, ?include_document_structure: bool, ?extract_images: bool, ?max_image_size: Integer, ?capture_svg: bool, ?infer_dimensions: bool, ?max_depth: Integer?, ?exclude_selectors: Array[String], ?tier_strategy: TierStrategy, ?visitor: VisitorHandle) -> void
109
+ 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, ?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, ?url_escape_style: enum_UrlEscapeStyle, ?link_style: enum_LinkStyle, ?output_format: enum_OutputFormat, ?include_document_structure: bool, ?extract_images: bool, ?max_image_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
108
110
  end
109
111
 
110
112
  class ConversionResult
@@ -125,12 +127,12 @@ def initialize: (?content: String, ?document: DocumentStructure, ?metadata: Html
125
127
  attr_reader canonical_url: String?
126
128
  attr_reader base_href: String?
127
129
  attr_reader language: String?
128
- attr_reader text_direction: TextDirection?
130
+ attr_reader text_direction: enum_TextDirection?
129
131
  attr_reader open_graph: Hash[String, String]
130
132
  attr_reader twitter_card: Hash[String, String]
131
133
  attr_reader meta_tags: Hash[String, String]
132
134
 
133
- def initialize: (?title: String, ?description: String, ?keywords: Array[String], ?author: String, ?canonical_url: String, ?base_href: String, ?language: String, ?text_direction: TextDirection, ?open_graph: Hash[String, String], ?twitter_card: Hash[String, String], ?meta_tags: Hash[String, String]) -> void
135
+ def initialize: (?title: String, ?description: String, ?keywords: Array[String], ?author: String, ?canonical_url: String, ?base_href: String, ?language: String, ?text_direction: enum_TextDirection, ?open_graph: Hash[String, String], ?twitter_card: Hash[String, String], ?meta_tags: Hash[String, String]) -> void
134
136
  end
135
137
 
136
138
  class DocumentNode
@@ -195,21 +197,21 @@ def initialize: (?document: DocumentMetadata, ?headers: Array[HeaderMetadata], ?
195
197
  attr_reader alt: String?
196
198
  attr_reader title: String?
197
199
  attr_reader dimensions: ImageDimensions?
198
- attr_reader image_type: ImageType
200
+ attr_reader image_type: enum_ImageType
199
201
  attr_reader attributes: Hash[String, String]
200
202
 
201
- def initialize: (src: String, ?alt: String, ?title: String, ?dimensions: ImageDimensions, image_type: ImageType, attributes: Hash[String, String]) -> void
203
+ def initialize: (src: String, ?alt: String, ?title: String, ?dimensions: ImageDimensions, image_type: enum_ImageType, attributes: Hash[String, String]) -> void
202
204
  end
203
205
 
204
206
  class LinkMetadata
205
207
  attr_reader href: String
206
208
  attr_reader text: String
207
209
  attr_reader title: String?
208
- attr_reader link_type: LinkType
210
+ attr_reader link_type: enum_LinkType
209
211
  attr_reader rel: Array[String]
210
212
  attr_reader attributes: Hash[String, String]
211
213
 
212
- def initialize: (href: String, text: String, ?title: String, link_type: LinkType, rel: Array[String], attributes: Hash[String, String]) -> void
214
+ def initialize: (href: String, text: String, ?title: String, link_type: enum_LinkType, rel: Array[String], attributes: Hash[String, String]) -> void
213
215
  end
214
216
 
215
217
  class MetadataEntry
@@ -220,49 +222,49 @@ def initialize: (href: String, text: String, ?title: String, link_type: LinkType
220
222
  end
221
223
 
222
224
  class NodeContext
223
- attr_reader node_type: NodeType
225
+ attr_reader node_type: enum_NodeType
224
226
  attr_reader tag_name: String
225
227
  attr_reader depth: Integer
226
228
  attr_reader index_in_parent: Integer
227
229
  attr_reader parent_tag: String?
228
230
  attr_reader is_inline: bool
229
231
 
230
- def initialize: (node_type: NodeType, tag_name: String, depth: Integer, index_in_parent: Integer, ?parent_tag: String, is_inline: bool) -> void
232
+ def initialize: (node_type: enum_NodeType, tag_name: String, depth: Integer, index_in_parent: Integer, ?parent_tag: String, is_inline: bool) -> void
231
233
  def attributes: () -> Hash[String, String]
232
234
  def into_owned: () -> NodeContext
233
235
  end
234
236
 
235
237
  class PreprocessingOptions
236
238
  attr_reader enabled: bool
237
- attr_reader preset: PreprocessingPreset
239
+ attr_reader preset: enum_PreprocessingPreset
238
240
  attr_reader remove_navigation: bool
239
241
  attr_reader remove_forms: bool
240
242
 
241
- def initialize: (?enabled: bool, ?preset: PreprocessingPreset, ?remove_navigation: bool, ?remove_forms: bool) -> void
243
+ def initialize: (?enabled: bool, ?preset: enum_PreprocessingPreset, ?remove_navigation: bool, ?remove_forms: bool) -> void
242
244
  end
243
245
 
244
246
  class PreprocessingOptionsUpdate
245
247
  attr_reader enabled: bool?
246
- attr_reader preset: PreprocessingPreset?
248
+ attr_reader preset: enum_PreprocessingPreset?
247
249
  attr_reader remove_navigation: bool?
248
250
  attr_reader remove_forms: bool?
249
251
 
250
- def initialize: (?enabled: bool, ?preset: PreprocessingPreset, ?remove_navigation: bool, ?remove_forms: bool) -> void
252
+ def initialize: (?enabled: bool, ?preset: enum_PreprocessingPreset, ?remove_navigation: bool, ?remove_forms: bool) -> void
251
253
  end
252
254
 
253
255
  class ProcessingWarning
254
256
  attr_reader message: String
255
- attr_reader kind: WarningKind
257
+ attr_reader kind: enum_WarningKind
256
258
 
257
- def initialize: (message: String, kind: WarningKind) -> void
259
+ def initialize: (message: String, kind: enum_WarningKind) -> void
258
260
  end
259
261
 
260
262
  class StructuredData
261
- attr_reader data_type: StructuredDataType
263
+ attr_reader data_type: enum_StructuredDataType
262
264
  attr_reader raw_json: String
263
265
  attr_reader schema_type: String?
264
266
 
265
- def initialize: (data_type: StructuredDataType, raw_json: String, ?schema_type: String) -> void
267
+ def initialize: (data_type: enum_StructuredDataType, raw_json: String, ?schema_type: String) -> void
266
268
  end
267
269
 
268
270
  class TableData
@@ -294,80 +296,53 @@ def initialize: (?rows: Integer, ?cols: Integer, ?cells: Array[GridCell]) -> voi
294
296
  class AnnotationKind
295
297
  end
296
298
 
297
- class CodeBlockStyle
298
- type value = :Indented | :Backticks | :Tildes
299
- end
299
+ type enum_CodeBlockStyle = :Indented | :Backticks | :Tildes
300
300
 
301
- class HeadingStyle
302
- type value = :Underlined | :Atx | :AtxClosed
303
- end
301
+ type enum_HeadingStyle = :Underlined | :Atx | :AtxClosed
304
302
 
305
- class HighlightStyle
306
- type value = :DoubleEqual | :Html | :Bold | :None
307
- end
303
+ type enum_HighlightStyle = :DoubleEqual | :Html | :Bold | :None
308
304
 
309
- class ImageType
310
- type value = :data_uri | :inline_svg | :external | :relative
311
- end
305
+ type enum_ImageType = :data_uri | :inline_svg | :external | :relative
312
306
 
313
- class LinkStyle
314
- type value = :Inline | :Reference
315
- end
307
+ type enum_LinkStyle = :Inline | :Reference
316
308
 
317
- class LinkType
318
- type value = :anchor | :internal | :external | :email | :phone | :other
319
- end
309
+ type enum_LinkType = :anchor | :internal | :external | :email | :phone | :other
320
310
 
321
- class ListIndentType
322
- type value = :Spaces | :Tabs
323
- end
311
+ type enum_ListIndentType = :Spaces | :Tabs
324
312
 
325
- class NewlineStyle
326
- type value = :Spaces | :Backslash
327
- end
313
+ type enum_NewlineStyle = :Spaces | :Backslash
328
314
 
329
315
  class NodeContent
330
316
  end
331
317
 
332
- class NodeType
333
- type value = :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
334
- end
318
+ 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
335
319
 
336
- class OutputFormat
337
- type value = :Markdown | :Djot | :Plain
338
- end
320
+ type enum_OutputFormat = :Markdown | :Djot | :Plain
339
321
 
340
- class PreprocessingPreset
341
- type value = :Minimal | :Standard | :Aggressive
342
- end
322
+ type enum_PreprocessingPreset = :Minimal | :Standard | :Aggressive
343
323
 
344
- class StructuredDataType
345
- type value = :json_ld | :microdata | :rdfa
346
- end
324
+ type enum_StructuredDataType = :json_ld | :microdata | :rdfa
347
325
 
348
- class TextDirection
349
- type value = :ltr | :rtl | :auto
350
- end
326
+ type enum_TextDirection = :ltr | :rtl | :auto
351
327
 
352
- class TierStrategy
353
- type value = :auto | :tier2 | :tier1
354
- end
328
+ type enum_TierStrategy = :auto | :tier2 | :tier1
355
329
 
356
- class UrlEscapeStyle
357
- type value = :Angle | :Percent
358
- end
330
+ type enum_UrlEscapeStyle = :Angle | :Percent
359
331
 
360
332
  class VisitResult
361
333
  end
362
334
 
363
- class WarningKind
364
- type value = :image_extraction_failed | :encoding_fallback | :truncated_input | :malformed_html | :sanitization_applied | :depth_limit_exceeded
365
- end
335
+ type enum_WarningKind = :image_extraction_failed | :encoding_fallback | :truncated_input | :malformed_html | :sanitization_applied | :depth_limit_exceeded
366
336
 
367
- class WhitespaceMode
368
- type value = :Normalized | :Strict
369
- end
337
+ type enum_WhitespaceMode = :Normalized | :Strict
370
338
 
371
339
  def self.convert: (String html, ?ConversionOptions options) -> ConversionResult
372
340
 
341
+ interface _HtmlVisitor
342
+ # Optional methods the bridge calls when the object defines them (the
343
+ # 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.
344
+ # The lifecycle hooks `initialize`/`shutdown` are likewise optional (note:
345
+ # Ruby constructors are private and never count as the lifecycle hook).
346
+ end
347
+
373
348
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-to-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.14.3
4
+ version: 3.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Na'aman Hirschfeld <naaman@xberg.io>
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-19 00:00:00.000000000 Z
11
+ date: 2026-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys