html-to-markdown 3.14.3 → 3.16.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:9cd1523beb892a6e5eef0c33a956855a8178865245dbf115fe62ed9e618d85ab
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.16.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:7c6e1f7268fd0bfae41495747b5df560e98fa6c7b17ab6e17963ab6c5f8e4e53
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,10 @@ 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 inline_data_media: enum_InlineDataMedia
46
+ attr_reader url_escape_style: enum_UrlEscapeStyle
47
+ attr_reader link_style: enum_LinkStyle
48
+ attr_reader output_format: enum_OutputFormat
48
49
  attr_reader include_document_structure: bool
49
50
  attr_reader extract_images: bool
50
51
  attr_reader max_image_size: Integer
@@ -52,15 +53,16 @@ type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Fl
52
53
  attr_reader infer_dimensions: bool
53
54
  attr_reader max_depth: Integer?
54
55
  attr_reader exclude_selectors: Array[String]
55
- attr_reader tier_strategy: TierStrategy
56
+ attr_reader tier_strategy: enum_TierStrategy
57
+ attr_reader base_url: String?
56
58
  attr_reader visitor: VisitorHandle?
57
59
 
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
60
+ 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, ?inline_data_media: enum_InlineDataMedia, ?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
61
  end
60
62
 
61
63
  class ConversionOptionsUpdate
62
- attr_reader heading_style: HeadingStyle?
63
- attr_reader list_indent_type: ListIndentType?
64
+ attr_reader heading_style: enum_HeadingStyle?
65
+ attr_reader list_indent_type: enum_ListIndentType?
64
66
  attr_reader list_indent_width: Integer?
65
67
  attr_reader bullets: String?
66
68
  attr_reader strong_em_symbol: String?
@@ -73,17 +75,17 @@ def initialize: (?heading_style: HeadingStyle, ?list_indent_type: ListIndentType
73
75
  attr_reader default_title: bool?
74
76
  attr_reader br_in_tables: bool?
75
77
  attr_reader compact_tables: bool?
76
- attr_reader highlight_style: HighlightStyle?
78
+ attr_reader highlight_style: enum_HighlightStyle?
77
79
  attr_reader extract_metadata: bool?
78
- attr_reader whitespace_mode: WhitespaceMode?
80
+ attr_reader whitespace_mode: enum_WhitespaceMode?
79
81
  attr_reader strip_newlines: bool?
80
82
  attr_reader wrap: bool?
81
83
  attr_reader wrap_width: Integer?
82
84
  attr_reader convert_as_inline: bool?
83
85
  attr_reader sub_symbol: String?
84
86
  attr_reader sup_symbol: String?
85
- attr_reader newline_style: NewlineStyle?
86
- attr_reader code_block_style: CodeBlockStyle?
87
+ attr_reader newline_style: enum_NewlineStyle?
88
+ attr_reader code_block_style: enum_CodeBlockStyle?
87
89
  attr_reader keep_inline_images_in: Array[String]?
88
90
  attr_reader preprocessing: PreprocessingOptionsUpdate?
89
91
  attr_reader encoding: String?
@@ -91,9 +93,10 @@ def initialize: (?heading_style: HeadingStyle, ?list_indent_type: ListIndentType
91
93
  attr_reader strip_tags: Array[String]?
92
94
  attr_reader preserve_tags: Array[String]?
93
95
  attr_reader skip_images: bool?
94
- attr_reader url_escape_style: UrlEscapeStyle?
95
- attr_reader link_style: LinkStyle?
96
- attr_reader output_format: OutputFormat?
96
+ attr_reader inline_data_media: enum_InlineDataMedia?
97
+ attr_reader url_escape_style: enum_UrlEscapeStyle?
98
+ attr_reader link_style: enum_LinkStyle?
99
+ attr_reader output_format: enum_OutputFormat?
97
100
  attr_reader include_document_structure: bool?
98
101
  attr_reader extract_images: bool?
99
102
  attr_reader max_image_size: Integer?
@@ -101,10 +104,11 @@ def initialize: (?heading_style: HeadingStyle, ?list_indent_type: ListIndentType
101
104
  attr_reader infer_dimensions: bool?
102
105
  attr_reader max_depth: Integer?
103
106
  attr_reader exclude_selectors: Array[String]?
104
- attr_reader tier_strategy: TierStrategy?
107
+ attr_reader tier_strategy: enum_TierStrategy?
108
+ attr_reader base_url: String?
105
109
  attr_reader visitor: VisitorHandle?
106
110
 
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
111
+ 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, ?inline_data_media: enum_InlineDataMedia, ?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
112
  end
109
113
 
110
114
  class ConversionResult
@@ -125,12 +129,12 @@ def initialize: (?content: String, ?document: DocumentStructure, ?metadata: Html
125
129
  attr_reader canonical_url: String?
126
130
  attr_reader base_href: String?
127
131
  attr_reader language: String?
128
- attr_reader text_direction: TextDirection?
132
+ attr_reader text_direction: enum_TextDirection?
129
133
  attr_reader open_graph: Hash[String, String]
130
134
  attr_reader twitter_card: Hash[String, String]
131
135
  attr_reader meta_tags: Hash[String, String]
132
136
 
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
137
+ 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
138
  end
135
139
 
136
140
  class DocumentNode
@@ -195,21 +199,21 @@ def initialize: (?document: DocumentMetadata, ?headers: Array[HeaderMetadata], ?
195
199
  attr_reader alt: String?
196
200
  attr_reader title: String?
197
201
  attr_reader dimensions: ImageDimensions?
198
- attr_reader image_type: ImageType
202
+ attr_reader image_type: enum_ImageType
199
203
  attr_reader attributes: Hash[String, String]
200
204
 
201
- def initialize: (src: String, ?alt: String, ?title: String, ?dimensions: ImageDimensions, image_type: ImageType, attributes: Hash[String, String]) -> void
205
+ def initialize: (src: String, ?alt: String, ?title: String, ?dimensions: ImageDimensions, image_type: enum_ImageType, attributes: Hash[String, String]) -> void
202
206
  end
203
207
 
204
208
  class LinkMetadata
205
209
  attr_reader href: String
206
210
  attr_reader text: String
207
211
  attr_reader title: String?
208
- attr_reader link_type: LinkType
212
+ attr_reader link_type: enum_LinkType
209
213
  attr_reader rel: Array[String]
210
214
  attr_reader attributes: Hash[String, String]
211
215
 
212
- def initialize: (href: String, text: String, ?title: String, link_type: LinkType, rel: Array[String], attributes: Hash[String, String]) -> void
216
+ def initialize: (href: String, text: String, ?title: String, link_type: enum_LinkType, rel: Array[String], attributes: Hash[String, String]) -> void
213
217
  end
214
218
 
215
219
  class MetadataEntry
@@ -220,49 +224,49 @@ def initialize: (href: String, text: String, ?title: String, link_type: LinkType
220
224
  end
221
225
 
222
226
  class NodeContext
223
- attr_reader node_type: NodeType
227
+ attr_reader node_type: enum_NodeType
224
228
  attr_reader tag_name: String
225
229
  attr_reader depth: Integer
226
230
  attr_reader index_in_parent: Integer
227
231
  attr_reader parent_tag: String?
228
232
  attr_reader is_inline: bool
229
233
 
230
- def initialize: (node_type: NodeType, tag_name: String, depth: Integer, index_in_parent: Integer, ?parent_tag: String, is_inline: bool) -> void
234
+ def initialize: (node_type: enum_NodeType, tag_name: String, depth: Integer, index_in_parent: Integer, ?parent_tag: String, is_inline: bool) -> void
231
235
  def attributes: () -> Hash[String, String]
232
236
  def into_owned: () -> NodeContext
233
237
  end
234
238
 
235
239
  class PreprocessingOptions
236
240
  attr_reader enabled: bool
237
- attr_reader preset: PreprocessingPreset
241
+ attr_reader preset: enum_PreprocessingPreset
238
242
  attr_reader remove_navigation: bool
239
243
  attr_reader remove_forms: bool
240
244
 
241
- def initialize: (?enabled: bool, ?preset: PreprocessingPreset, ?remove_navigation: bool, ?remove_forms: bool) -> void
245
+ def initialize: (?enabled: bool, ?preset: enum_PreprocessingPreset, ?remove_navigation: bool, ?remove_forms: bool) -> void
242
246
  end
243
247
 
244
248
  class PreprocessingOptionsUpdate
245
249
  attr_reader enabled: bool?
246
- attr_reader preset: PreprocessingPreset?
250
+ attr_reader preset: enum_PreprocessingPreset?
247
251
  attr_reader remove_navigation: bool?
248
252
  attr_reader remove_forms: bool?
249
253
 
250
- def initialize: (?enabled: bool, ?preset: PreprocessingPreset, ?remove_navigation: bool, ?remove_forms: bool) -> void
254
+ def initialize: (?enabled: bool, ?preset: enum_PreprocessingPreset, ?remove_navigation: bool, ?remove_forms: bool) -> void
251
255
  end
252
256
 
253
257
  class ProcessingWarning
254
258
  attr_reader message: String
255
- attr_reader kind: WarningKind
259
+ attr_reader kind: enum_WarningKind
256
260
 
257
- def initialize: (message: String, kind: WarningKind) -> void
261
+ def initialize: (message: String, kind: enum_WarningKind) -> void
258
262
  end
259
263
 
260
264
  class StructuredData
261
- attr_reader data_type: StructuredDataType
265
+ attr_reader data_type: enum_StructuredDataType
262
266
  attr_reader raw_json: String
263
267
  attr_reader schema_type: String?
264
268
 
265
- def initialize: (data_type: StructuredDataType, raw_json: String, ?schema_type: String) -> void
269
+ def initialize: (data_type: enum_StructuredDataType, raw_json: String, ?schema_type: String) -> void
266
270
  end
267
271
 
268
272
  class TableData
@@ -294,80 +298,55 @@ def initialize: (?rows: Integer, ?cols: Integer, ?cells: Array[GridCell]) -> voi
294
298
  class AnnotationKind
295
299
  end
296
300
 
297
- class CodeBlockStyle
298
- type value = :Indented | :Backticks | :Tildes
299
- end
301
+ type enum_CodeBlockStyle = :Indented | :Backticks | :Tildes
300
302
 
301
- class HeadingStyle
302
- type value = :Underlined | :Atx | :AtxClosed
303
- end
303
+ type enum_HeadingStyle = :Underlined | :Atx | :AtxClosed
304
304
 
305
- class HighlightStyle
306
- type value = :DoubleEqual | :Html | :Bold | :None
307
- end
305
+ type enum_HighlightStyle = :DoubleEqual | :Html | :Bold | :None
308
306
 
309
- class ImageType
310
- type value = :data_uri | :inline_svg | :external | :relative
311
- end
307
+ type enum_ImageType = :data_uri | :inline_svg | :external | :relative
312
308
 
313
- class LinkStyle
314
- type value = :Inline | :Reference
315
- end
309
+ type enum_InlineDataMedia = :Keep | :AltTextOnly | :DropElement
316
310
 
317
- class LinkType
318
- type value = :anchor | :internal | :external | :email | :phone | :other
319
- end
311
+ type enum_LinkStyle = :Inline | :Reference
320
312
 
321
- class ListIndentType
322
- type value = :Spaces | :Tabs
323
- end
313
+ type enum_LinkType = :anchor | :internal | :external | :email | :phone | :other
324
314
 
325
- class NewlineStyle
326
- type value = :Spaces | :Backslash
327
- end
315
+ type enum_ListIndentType = :Spaces | :Tabs
316
+
317
+ type enum_NewlineStyle = :Spaces | :Backslash
328
318
 
329
319
  class NodeContent
330
320
  end
331
321
 
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
322
+ 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
323
 
336
- class OutputFormat
337
- type value = :Markdown | :Djot | :Plain
338
- end
324
+ type enum_OutputFormat = :Markdown | :Djot | :Plain
339
325
 
340
- class PreprocessingPreset
341
- type value = :Minimal | :Standard | :Aggressive
342
- end
326
+ type enum_PreprocessingPreset = :Minimal | :Standard | :Aggressive
343
327
 
344
- class StructuredDataType
345
- type value = :json_ld | :microdata | :rdfa
346
- end
328
+ type enum_StructuredDataType = :json_ld | :microdata | :rdfa
347
329
 
348
- class TextDirection
349
- type value = :ltr | :rtl | :auto
350
- end
330
+ type enum_TextDirection = :ltr | :rtl | :auto
351
331
 
352
- class TierStrategy
353
- type value = :auto | :tier2 | :tier1
354
- end
332
+ type enum_TierStrategy = :auto | :tier2 | :tier1
355
333
 
356
- class UrlEscapeStyle
357
- type value = :Angle | :Percent
358
- end
334
+ type enum_UrlEscapeStyle = :Angle | :Percent
359
335
 
360
336
  class VisitResult
361
337
  end
362
338
 
363
- class WarningKind
364
- type value = :image_extraction_failed | :encoding_fallback | :truncated_input | :malformed_html | :sanitization_applied | :depth_limit_exceeded
365
- end
339
+ type enum_WarningKind = :image_extraction_failed | :encoding_fallback | :truncated_input | :malformed_html | :sanitization_applied | :depth_limit_exceeded
366
340
 
367
- class WhitespaceMode
368
- type value = :Normalized | :Strict
369
- end
341
+ type enum_WhitespaceMode = :Normalized | :Strict
370
342
 
371
343
  def self.convert: (String html, ?ConversionOptions options) -> ConversionResult
372
344
 
345
+ interface _HtmlVisitor
346
+ # Optional methods the bridge calls when the object defines them (the
347
+ # 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.
348
+ # The lifecycle hooks `initialize`/`shutdown` are likewise optional (note:
349
+ # Ruby constructors are private and never count as the lifecycle hook).
350
+ end
351
+
373
352
  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.16.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-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys