commonmarker 1.1.5-aarch64-linux → 2.0.1-aarch64-linux
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 +4 -4
- data/README.md +13 -10
- data/lib/commonmarker/3.1/commonmarker.so +0 -0
- data/lib/commonmarker/3.2/commonmarker.so +0 -0
- data/lib/commonmarker/3.3/commonmarker.so +0 -0
- data/lib/commonmarker/config.rb +17 -27
- data/lib/commonmarker/utils.rb +6 -6
- data/lib/commonmarker/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 486938d51933e6e686cea65a4057e19c76e8377d94c1879ed29afa6552dd91c6
         | 
| 4 | 
            +
              data.tar.gz: 79baa1a50f9c63978a8e7cb986c4fa82a92b98e2999259d15950c2b4cb78343f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 98be7ebb8f250d43b78e946ee16627e64ae4eb769c9afd46a23d3e0cb09525656700f14d43dc16ae94488089cbc4118ab8ab51659edf6b701cda3ffbe42057a8
         | 
| 7 | 
            +
              data.tar.gz: 5edb74a0a4211a881ef7a796af2551d7458a6777523cf07500dbb20c7b47536ade99f5ef9891c73be24603d8df92a3d625d7227329fe5f54ecda90f51ac52b06
         | 
    
        data/README.md
    CHANGED
    
    | @@ -4,7 +4,10 @@ Ruby wrapper for Rust's [comrak](https://github.com/kivikakk/comrak) crate. | |
| 4 4 |  | 
| 5 5 | 
             
            It passes all of the CommonMark test suite, and is therefore spec-complete. It also includes extensions to the CommonMark spec as documented in the [GitHub Flavored Markdown spec](http://github.github.com/gfm/), such as support for tables, strikethroughs, and autolinking.
         | 
| 6 6 |  | 
| 7 | 
            -
             | 
| 7 | 
            +
            > [!NOTE]
         | 
| 8 | 
            +
            > By default, several extensions not in any spec have been enabled, for the sake of end user convenience when generating HTML.
         | 
| 9 | 
            +
            >
         | 
| 10 | 
            +
            > For more information on the available options and extensions, see [the documentation below](#options-and-plugins).
         | 
| 8 11 |  | 
| 9 12 | 
             
            ## Installation
         | 
| 10 13 |  | 
| @@ -86,7 +89,7 @@ You can also modify the following attributes: | |
| 86 89 | 
             
            You can use `walk` or `each` to iterate over nodes:
         | 
| 87 90 |  | 
| 88 91 | 
             
            - `walk` will iterate on a node and recursively iterate on a node's children.
         | 
| 89 | 
            -
            - `each` will iterate on a node  | 
| 92 | 
            +
            - `each` will iterate on a node's direct children, but no further.
         | 
| 90 93 |  | 
| 91 94 | 
             
            ```ruby
         | 
| 92 95 | 
             
            require 'commonmarker'
         | 
| @@ -147,16 +150,16 @@ Commonmarker.to_html('"Hi *there*"', options:{ | |
| 147 150 | 
             
            })
         | 
| 148 151 | 
             
            ```
         | 
| 149 152 |  | 
| 150 | 
            -
            Note that there is a distinction in comrak for "parse" options and "render" options, which are represented in the tables below.
         | 
| 153 | 
            +
            Note that there is a distinction in comrak for "parse" options and "render" options, which are represented in the tables below. As well, if you wish to disable any-non boolean option, pass in `nil`.
         | 
| 151 154 |  | 
| 152 155 | 
             
            ### Parse options
         | 
| 153 156 |  | 
| 154 | 
            -
            | Name | 
| 155 | 
            -
            |  | 
| 156 | 
            -
            | `smart` | 
| 157 | 
            -
            | `default_info_string` | 
| 158 | 
            -
            | `relaxed_tasklist_matching` | 
| 159 | 
            -
            | `relaxed_autolinks` | 
| 157 | 
            +
            | Name                        | Description                                                                                                                                 | Default |
         | 
| 158 | 
            +
            | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
         | 
| 159 | 
            +
            | `smart`                     | Punctuation (quotes, full-stops and hyphens) are converted into 'smart' punctuation.                                                        | `false` |
         | 
| 160 | 
            +
            | `default_info_string`       | The default info string for fenced code blocks.                                                                                             | `""`    |
         | 
| 161 | 
            +
            | `relaxed_tasklist_matching` | Enables relaxing of the tasklist extension matching, allowing any non-space to be used for the "checked" state instead of only `x` and `X`. | `false` |
         | 
| 162 | 
            +
            | `relaxed_autolinks`         | Enable relaxing of the autolink extension parsing, allowing links to be recognized when in brackets, as well as permitting any url scheme.  | `false` |
         | 
| 160 163 |  | 
| 161 164 | 
             
            ### Render options
         | 
| 162 165 |  | 
| @@ -187,7 +190,7 @@ Commonmarker.to_html('"Hi *there*"', options: { | |
| 187 190 | 
             
            ### Extension options
         | 
| 188 191 |  | 
| 189 192 | 
             
            | Name                          | Description                                                                                                         | Default |
         | 
| 190 | 
            -
            |  | 
| 193 | 
            +
            | ----------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------- |
         | 
| 191 194 | 
             
            | `strikethrough`               | Enables the [strikethrough extension](https://github.github.com/gfm/#strikethrough-extension-) from the GFM spec.   | `true`  |
         | 
| 192 195 | 
             
            | `tagfilter`                   | Enables the [tagfilter extension](https://github.github.com/gfm/#disallowed-raw-html-extension-) from the GFM spec. | `true`  |
         | 
| 193 196 | 
             
            | `table`                       | Enables the [table extension](https://github.github.com/gfm/#tables-extension-) from the GFM spec.                  | `true`  |
         | 
| Binary file | 
| Binary file | 
| Binary file | 
    
        data/lib/commonmarker/config.rb
    CHANGED
    
    | @@ -45,7 +45,8 @@ module Commonmarker | |
| 45 45 | 
             
                    underline: false,
         | 
| 46 46 | 
             
                    spoiler: false,
         | 
| 47 47 | 
             
                    greentext: false,
         | 
| 48 | 
            -
             | 
| 48 | 
            +
                    subscript: false,
         | 
| 49 | 
            +
                  }.freeze,
         | 
| 49 50 | 
             
                  format: [:html].freeze,
         | 
| 50 51 | 
             
                }.freeze
         | 
| 51 52 |  | 
| @@ -59,15 +60,11 @@ module Commonmarker | |
| 59 60 | 
             
                class << self
         | 
| 60 61 | 
             
                  include Commonmarker::Utils
         | 
| 61 62 |  | 
| 62 | 
            -
                  def merged_with_defaults(options)
         | 
| 63 | 
            -
                    Commonmarker::Config::OPTIONS.merge(process_options(options))
         | 
| 64 | 
            -
                  end
         | 
| 65 | 
            -
             | 
| 66 63 | 
             
                  def process_options(options)
         | 
| 67 64 | 
             
                    {
         | 
| 68 | 
            -
                      parse: process_parse_options(options[:parse]),
         | 
| 69 | 
            -
                      render: process_render_options(options[:render]),
         | 
| 70 | 
            -
                      extension: process_extension_options(options[:extension]),
         | 
| 65 | 
            +
                      parse: process_parse_options(options[:parse].dup),
         | 
| 66 | 
            +
                      render: process_render_options(options[:render].dup),
         | 
| 67 | 
            +
                      extension: process_extension_options(options[:extension].dup),
         | 
| 71 68 | 
             
                    }
         | 
| 72 69 | 
             
                  end
         | 
| 73 70 |  | 
| @@ -79,37 +76,30 @@ module Commonmarker | |
| 79 76 | 
             
                end
         | 
| 80 77 |  | 
| 81 78 | 
             
                [:parse, :render, :extension].each do |type|
         | 
| 82 | 
            -
                  define_singleton_method :"process_#{type}_options" do | | 
| 79 | 
            +
                  define_singleton_method :"process_#{type}_options" do |options|
         | 
| 83 80 | 
             
                    Commonmarker::Config::OPTIONS[type].each_with_object({}) do |(key, value), hash|
         | 
| 84 | 
            -
                      if  | 
| 81 | 
            +
                      if options.nil? || !options.key?(key) # option not provided, use the default
         | 
| 85 82 | 
             
                        hash[key] = value
         | 
| 86 83 | 
             
                        next
         | 
| 87 84 | 
             
                      end
         | 
| 88 85 |  | 
| 89 | 
            -
                      # option explicitly not included, remove it
         | 
| 90 | 
            -
             | 
| 86 | 
            +
                      if options[key].nil? # # option explicitly not included, remove it
         | 
| 87 | 
            +
                        options.delete(key)
         | 
| 88 | 
            +
                        next
         | 
| 89 | 
            +
                      end
         | 
| 91 90 |  | 
| 92 | 
            -
                      hash[key] = fetch_kv( | 
| 91 | 
            +
                      hash[key] = fetch_kv(options, key, value, type)
         | 
| 93 92 | 
             
                    end
         | 
| 94 93 | 
             
                  end
         | 
| 95 94 | 
             
                end
         | 
| 96 95 |  | 
| 97 | 
            -
                 | 
| 98 | 
            -
                   | 
| 99 | 
            -
                    return if plugin.nil? # plugin explicitly nil, remove it
         | 
| 96 | 
            +
                define_singleton_method :process_syntax_highlighter_plugin do |options|
         | 
| 97 | 
            +
                  return if options.nil? # plugin explicitly nil, remove it
         | 
| 100 98 |  | 
| 101 | 
            -
             | 
| 102 | 
            -
             | 
| 103 | 
            -
                        hash[key] = value
         | 
| 104 | 
            -
                        next
         | 
| 105 | 
            -
                      end
         | 
| 99 | 
            +
                  raise TypeError, "Expected a Hash for syntax_highlighter plugin, got #{options.class}" unless options.is_a?(Hash)
         | 
| 100 | 
            +
                  raise TypeError, "Expected a Hash for syntax_highlighter plugin, got nothing" if options.empty?
         | 
| 106 101 |  | 
| 107 | 
            -
             | 
| 108 | 
            -
                      next if plugin[key].nil?
         | 
| 109 | 
            -
             | 
| 110 | 
            -
                      hash[key] = fetch_kv(plugin, key, value, type)
         | 
| 111 | 
            -
                    end
         | 
| 112 | 
            -
                  end
         | 
| 102 | 
            +
                  Commonmarker::Config::PLUGINS[:syntax_highlighter].merge(options)
         | 
| 113 103 | 
             
                end
         | 
| 114 104 | 
             
              end
         | 
| 115 105 | 
             
            end
         | 
    
        data/lib/commonmarker/utils.rb
    CHANGED
    
    | @@ -6,16 +6,16 @@ module Commonmarker | |
| 6 6 | 
             
              module Utils
         | 
| 7 7 | 
             
                include Commonmarker::Constants
         | 
| 8 8 |  | 
| 9 | 
            -
                def fetch_kv( | 
| 9 | 
            +
                def fetch_kv(options, key, value, type)
         | 
| 10 10 | 
             
                  value_klass = value.class
         | 
| 11 11 |  | 
| 12 | 
            -
                  if Constants::BOOLS.include?(value) && BOOLS.include?( | 
| 13 | 
            -
                     | 
| 14 | 
            -
                  elsif  | 
| 15 | 
            -
                     | 
| 12 | 
            +
                  if Constants::BOOLS.include?(value) && BOOLS.include?(options[key])
         | 
| 13 | 
            +
                    options[key]
         | 
| 14 | 
            +
                  elsif options[key].is_a?(value_klass)
         | 
| 15 | 
            +
                    options[key]
         | 
| 16 16 | 
             
                  else
         | 
| 17 17 | 
             
                    expected_type = Constants::BOOLS.include?(value) ? "Boolean" : value_klass.to_s
         | 
| 18 | 
            -
                    raise TypeError, "#{type} option `:#{key}` must be #{expected_type}; got #{ | 
| 18 | 
            +
                    raise TypeError, "#{type} option `:#{key}` must be #{expected_type}; got #{options[key].class}"
         | 
| 19 19 | 
             
                  end
         | 
| 20 20 | 
             
                end
         | 
| 21 21 | 
             
              end
         | 
    
        data/lib/commonmarker/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: commonmarker
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version:  | 
| 4 | 
            +
              version: 2.0.1
         | 
| 5 5 | 
             
            platform: aarch64-linux
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Garen Torikian
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: exe
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2024- | 
| 12 | 
            +
            date: 2024-11-28 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: rake
         |