html-to-markdown 3.2.4-arm64-darwin → 3.4.0-arm64-darwin

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: e52a0d784ead0794931edc5b060cf21fb332600811373f73b858cc5d067c7569
4
- data.tar.gz: 3d06b786d18e00fa5dd6e15861f1040fa01eab19a63284aadf61474c9cfbf273
3
+ metadata.gz: 2ebefc5b22bc1f53421d8f1708693954e1dcd3cab5dce048ec1b0b57b8e3e4d7
4
+ data.tar.gz: f7c4e43514522b753a60d43d2085280e6be35dd75acf391194f88e8bdf9e7a53
5
5
  SHA512:
6
- metadata.gz: 48304424d46192902ae57e3249ed835f91989df4d94a08c3b2add6995630acfb9e141dd38f931ebd2575f763a9b3380bb1d8bdcbb1ec529706a6be32aef93236
7
- data.tar.gz: 2c2bacea0350beb9159994741c21ef5bd6f224461665638fb6fc9772351f2783dad54208047e2e89d71c1956c5f2c695f5ce4ff5da55781450732c61145107ea
6
+ metadata.gz: dce714cc4d995831757f5a3a625ccbd5fc40176184a2bb65f159703da408779b9035ba8711f26823c837490d16e27f84afb1bb8df61ee8252e9f09ba8fe14e2a
7
+ data.tar.gz: 0c710a56e9b98ab62dce56f4419af88546c87f9289e3aff1d2bae7ff6e469cc55eaf11c60b0f15266d704bf8f35aa711b33548a33ddc6a9b356e2453374f484c
data/Steepfile CHANGED
@@ -1,26 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Steepfile for type checking html-to-markdown Ruby gem
4
-
5
3
  target :lib do
6
4
  signature 'sig'
7
-
8
5
  check 'lib'
9
-
10
- # Configure libraries
11
- library 'pathname'
12
- library 'open3'
13
-
14
- # Ignore vendor directory
15
- ignore 'vendor'
16
-
17
- # Ignore spec directory
18
- ignore 'spec'
19
-
20
- # Ignore bin directory
21
- ignore 'bin'
22
-
23
- # Ignore internal implementation modules (not public API)
24
- ignore 'lib/html_to_markdown/cli.rb'
25
- ignore 'lib/html_to_markdown/cli_proxy.rb'
26
6
  end
Binary file
@@ -0,0 +1,59 @@
1
+ # This file is auto-generated by alef — DO NOT EDIT.
2
+ # alef:hash:b54e7bb2ab55cc6c25c9cac0e62ec66c35fd2d1956ef9ba5e3dc9e7ba5e666a5
3
+ # To regenerate: alef generate
4
+ # To verify freshness: alef verify --exit-code
5
+ # Issues & docs: https://github.com/kreuzberg-dev/alef
6
+ # frozen_string_literal: true
7
+
8
+ require 'json'
9
+ require 'html_to_markdown_rb'
10
+ module HtmlToMarkdown
11
+ # Re-export all public module functions from the native extension
12
+ HtmlToMarkdownRs.methods(false).each do |m|
13
+ define_singleton_method(m) { |*args, **kwargs, &blk| HtmlToMarkdownRs.public_send(m, *args, **kwargs, &blk) }
14
+ end
15
+
16
+ # Re-export all constants (classes, structs, etc.) from the native extension
17
+ HtmlToMarkdownRs.constants.each do |c|
18
+ const_set(c, HtmlToMarkdownRs.const_get(c)) unless const_defined?(c)
19
+ end
20
+ end
21
+
22
+ # Add accessor methods to Hash-based internally-tagged enum instances
23
+ class Hash
24
+ # Support internally-tagged enum accessors like format.excel, format.email, etc.
25
+ # Also support direct field access like format.sheet_count
26
+ # rubocop:disable Metrics/CyclomaticComplexity
27
+ def method_missing(method_name, *args, &block)
28
+ # Try symbol key first (how Magnus converts JSON keys)
29
+ return self[method_name] if key?(method_name)
30
+
31
+ # Try string key
32
+ return self[method_name.to_s] if key?(method_name.to_s)
33
+
34
+ # Check if this hash has a 'format_type' field (indicating an internally-tagged enum)
35
+ format_type = self[:'format_type'] || self['format_type']
36
+ return super unless format_type
37
+
38
+ # If the method name matches the format_type (snake_case), extract and return the variant's wrapped data
39
+ # Internally-tagged enums store variant data in the '_0' field (from alef's struct variant conversion)
40
+ # This allows format.excel to return the ExcelMetadata hash with sheet_count, sheet_names, etc.
41
+ snake_case_method = method_name.to_s.downcase
42
+ if snake_case_method == format_type.to_s.downcase
43
+ return self[:'_0'] || self['_0'] || self
44
+ end
45
+
46
+ super
47
+ end
48
+ # rubocop:enable Metrics/CyclomaticComplexity
49
+
50
+ def respond_to_missing?(method_name, include_private = false)
51
+ return true if key?(method_name) || key?(method_name.to_s)
52
+
53
+ format_type = self[:'format_type'] || self['format_type']
54
+ return false unless format_type
55
+
56
+ snake_case_method = method_name.to_s.downcase
57
+ snake_case_method == format_type.to_s.downcase || super
58
+ end
59
+ end
@@ -1,5 +1,10 @@
1
+ # This file is auto-generated by alef — DO NOT EDIT.
2
+ # alef:hash:9c58cf63849e82246f03b4fcc3996c264d47f2b2c27e0e8ba6b93eb4a84cb279
3
+ # To regenerate: alef generate
4
+ # To verify freshness: alef verify --exit-code
5
+ # Issues & docs: https://github.com/kreuzberg-dev/alef
1
6
  # frozen_string_literal: true
2
7
 
3
8
  module HtmlToMarkdown
4
- VERSION = '3.2.4'
9
+ VERSION = '3.4.0'
5
10
  end
@@ -1,40 +1,13 @@
1
+ # This file is auto-generated by alef — DO NOT EDIT.
2
+ # alef:hash:b671355c68864d5f935b91f875ab29144d9543baad5a955cd926ab9881762a19
3
+ # To regenerate: alef generate
4
+ # To verify freshness: alef verify --exit-code
5
+ # Issues & docs: https://github.com/kreuzberg-dev/alef
1
6
  # frozen_string_literal: true
2
7
 
3
8
  require_relative 'html_to_markdown/version'
4
- require 'html_to_markdown_rb'
9
+ require_relative 'html_to_markdown/native'
5
10
 
6
- # High-performance HTML to Markdown conversion.
7
- #
8
- # @example Simple conversion
9
- # HtmlToMarkdown.convert('<h1>Hello</h1>') # => "# Hello\n\n"
10
- #
11
- # @example With options
12
- # HtmlToMarkdown.convert('<h1>Hello</h1>', heading_style: 'atx')
13
11
  module HtmlToMarkdown
14
- # Convert HTML to Markdown.
15
- #
16
- # @param html [String] The HTML content to convert.
17
- # @param options [Hash] Optional conversion options.
18
- # Supported keys (all optional):
19
- # - :heading_style - 'atx', 'atx_closed', 'setext', 'underlined'
20
- # - :code_block_style - 'backticks', 'tildes', 'indented'
21
- # - :escape_asterisks - Boolean
22
- # - :escape_underscores - Boolean
23
- # - :escape_misc - Boolean
24
- # - :escape_ascii - Boolean
25
- # - :strip_newlines - Boolean
26
- # - :keep_inline_images_in - Array of tag names
27
- # - :strip_tags - Array of tag names to strip
28
- # - :preserve_tags - Array of tag names to preserve verbatim
29
- # (and more, matching ConversionOptions fields)
30
- # @return [String] The converted Markdown content.
31
- def self.convert(html, options = {})
32
- opts = if options.nil? || options.empty?
33
- nil
34
- else
35
- HtmlToMarkdownRs::ConversionOptions.new(options)
36
- end
37
- result = HtmlToMarkdownRs.convert(html, opts)
38
- result.content || ''
39
- end
12
+ # Re-export all types and functions from native extension
40
13
  end
Binary file