commonmarker 1.1.5-aarch64-linux → 2.0.0-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87c40f9e4235b48f10cbaa03a9a6095a6024c4876a42b9021a130522ceb7e11f
4
- data.tar.gz: 915709756a8b45a86a4985825727a395391e823f7bcd80397444cf38c8dffc41
3
+ metadata.gz: 321b377172d891d6f3799ca16fd0d898d7df2b90e201be1ac659112f5d5bfab3
4
+ data.tar.gz: ed26c92b8b5348a6a08c826845604f3af2408a3bc28fb1207c126341b4bac1c2
5
5
  SHA512:
6
- metadata.gz: 59a1334c80e69c855ad576396c89d738897c56acc8da17122eca92c54a3c95eb7f61d22ace3533ec19b95cd8819b5f66f757e23651e009decdcdc7ad9ee9c765
7
- data.tar.gz: 648615e0ba218305c0c82c0bb2c8ae5606c56e1582d1e3ec34dfd063521500994d97a071d4543ded8248ed1af2af4b719142da35e9f3002d989877f0a6f98045
6
+ metadata.gz: 847f7c7166784957f7c85c3b388c3d5fc57759df310ec1a8f626a02639da58c5d7c2bd30c803e433702368afac506ad57eba7eeccc96c5e988e75cdf57bf8c26
7
+ data.tar.gz: 5cf3c808480fa44901714a2d956e19aef8d590e07afe426122da890426d33d66b80156cf366b8fcf373e882db8d3367c752697bbbf9e701688f5a51ec631b42e
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
- For more information on available extensions, see [the documentation below](#extension-options).
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 and its children, but no further.
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 | Description | Default |
155
- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
156
- | `smart` | Punctuation (quotes, full-stops and hyphens) are converted into 'smart' punctuation. | `false` |
157
- | `default_info_string` | The default info string for fenced code blocks. | `""` |
158
- | `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` |
159
- | `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` |
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
@@ -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,10 +60,6 @@ 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
65
  parse: process_parse_options(options[:parse]),
@@ -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 |option|
79
+ define_singleton_method :"process_#{type}_options" do |options|
83
80
  Commonmarker::Config::OPTIONS[type].each_with_object({}) do |(key, value), hash|
84
- if option.nil? # option not provided, go for the default
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
- next if option[key].nil?
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(option, key, value, type)
91
+ hash[key] = fetch_kv(options, key, value, type)
93
92
  end
94
93
  end
95
94
  end
96
95
 
97
- [:syntax_highlighter].each do |type|
98
- define_singleton_method :"process_#{type}_plugin" do |plugin|
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
- Commonmarker::Config::PLUGINS[type].each_with_object({}) do |(key, value), hash|
102
- if plugin.nil? # option not provided, go for the default
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
- # option explicitly not included, remove it
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
@@ -6,16 +6,16 @@ module Commonmarker
6
6
  module Utils
7
7
  include Commonmarker::Constants
8
8
 
9
- def fetch_kv(option, key, value, type)
9
+ def fetch_kv(options, key, value, type)
10
10
  value_klass = value.class
11
11
 
12
- if Constants::BOOLS.include?(value) && BOOLS.include?(option[key])
13
- option[key]
14
- elsif option[key].is_a?(value_klass)
15
- option[key]
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 #{option[key].class}"
18
+ raise TypeError, "#{type} option `:#{key}` must be #{expected_type}; got #{options[key].class}"
19
19
  end
20
20
  end
21
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmarker
4
- VERSION = "1.1.5"
4
+ VERSION = "2.0.0"
5
5
  end
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: 1.1.5
4
+ version: 2.0.0
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-07-29 00:00:00.000000000 Z
12
+ date: 2024-11-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake