commonmarker 2.10.0-x86_64-linux → 2.10.1-x86_64-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: 9ce6b951b17bb332437fd707359b206756948e4c71a1446aef9b2e1466622e43
4
- data.tar.gz: 129ae692bbaa24696a7ef0900dad2cae399631e9d26f3f038eb900792b5ffce9
3
+ metadata.gz: 00a3350f896c71d801eb0bebb85acf213a49959e00f742323ac6670ca79afec3
4
+ data.tar.gz: 1368ab5bcbcb79d78dfc2d83c1591984a469295cc37896c53c43153320406bda
5
5
  SHA512:
6
- metadata.gz: 71fde760c2ac2d8035b0090e7b0270e1f0147bc66d5a05b157a54248b630107ac0e299453fed9fa2269d6c1be97ade2788f40790e15c0b77cf8d837b70795ffa
7
- data.tar.gz: 0b3c60142ac4e0b9440c4a08f3ed7fde610f27615438b638eb98349142df89dbaf51b62a4faae051cf176f54b93b7bce28893ee94ed12a00fc04eaca827434dd
6
+ metadata.gz: f304aad279c88165a95e755ca54f5c3d395a5fd26147b49ed2d9034a413f233ae18feb0dc94af397609ede2d7a27c1efb01fd7dd60f9291c76acad27af71b826
7
+ data.tar.gz: ee78ba9cdb77b6869bfb6884ae3fd65613929216b12471663e471d77aa3f3d5a0e50ba8b9b76034db2dcf0d3e8d13407d2947807778a1e35cf547bafdebd5899
data/README.md CHANGED
@@ -5,7 +5,7 @@ Ruby wrapper for Rust's [comrak](https://github.com/kivikakk/comrak) crate.
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, the following extensions are enabled for end user convenience: `strikethrough`, `tagfilter`, `table`, `autolink`, `tasklist` (all from the [GFM spec](http://github.github.com/gfm/)), and `shortcodes`. The `syntax_highlighter` plugin is also enabled by default, using the `"base16-ocean.dark"` theme.
8
+ > By default, the following extensions are enabled for end user convenience: `strikethrough`, `table`, `autolink`, `tasklist` (all from the [GFM spec](http://github.github.com/gfm/)), and `shortcodes`. The `syntax_highlighter` plugin is also enabled by default, using the `"base16-ocean.dark"` theme.
9
9
  >
10
10
  > For more information on the available options and extensions, see [the documentation below](#options-and-plugins).
11
11
 
@@ -184,6 +184,7 @@ Note that there is a distinction in comrak for "parse" options and "render" opti
184
184
  | `leave_footnote_definitions` | Allow footnote definitions to remain in their original positions instead of being moved to the document's end (only affects AST) | `false` |
185
185
  | `ignore_setext` | Ignores setext-style headings. | `false` |
186
186
  | `sourcepos_chars` | Use character-based column tracking in source positions instead of byte-based. Relevant for multi-byte UTF-8 documents with `sourcepos`. | `false` |
187
+ | `max_nesting_depth` | The deepest a node may nest below the document. Deeper documents raise `Commonmarker::NestingDepthExceededError` instead of being parsed. | `1000` |
187
188
 
188
189
  ### Render options
189
190
 
@@ -218,7 +219,6 @@ Commonmarker.to_html('"Hi *there*"', options: {
218
219
  | Name | Description | Default |
219
220
  | ----------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------- |
220
221
  | `strikethrough` | Enables the [strikethrough extension](https://github.github.com/gfm/#strikethrough-extension-) from the GFM spec. | `true` |
221
- | `tagfilter` | Enables the [tagfilter extension](https://github.github.com/gfm/#disallowed-raw-html-extension-) from the GFM spec. | `true` |
222
222
  | `table` | Enables the [table extension](https://github.github.com/gfm/#tables-extension-) from the GFM spec. | `true` |
223
223
  | `autolink` | Enables the [autolink extension](https://github.github.com/gfm/#autolinks-extension-) from the GFM spec. | `true` |
224
224
  | `tasklist` | Enables the [task list extension](https://github.github.com/gfm/#task-list-items-extension-) from the GFM spec. | `true` |
Binary file
Binary file
Binary file
Binary file
@@ -13,6 +13,7 @@ module Commonmarker
13
13
  leave_footnote_definitions: false,
14
14
  ignore_setext: false,
15
15
  sourcepos_chars: false,
16
+ max_nesting_depth: 1000,
16
17
  }.freeze,
17
18
  render: {
18
19
  hardbreaks: true,
@@ -32,7 +33,6 @@ module Commonmarker
32
33
  }.freeze,
33
34
  extension: {
34
35
  strikethrough: true,
35
- tagfilter: true,
36
36
  table: true,
37
37
  autolink: true,
38
38
  tasklist: true,
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Commonmarker
4
+ # Raised when a document nests more deeply than the `max_nesting_depth`
5
+ # parse option allows.
6
+ class NestingDepthExceededError < StandardError; end
7
+ end
@@ -20,15 +20,28 @@ module Commonmarker
20
20
  super
21
21
  end
22
22
 
23
- # Public: An iterator that "walks the tree," descending into children recursively.
23
+ # Public: An iterator that "walks the tree," yielding each node and then
24
+ # its descendants, in document order.
24
25
  #
25
- # blk - A {Proc} representing the action to take for each child
26
+ # The walk is iterative rather than recursive, so arbitrarily deep trees
27
+ # can't exhaust the stack.
28
+ #
29
+ # blk - A {Proc} representing the action to take for each node
26
30
  def walk(&block)
27
31
  return enum_for(:walk) unless block
28
32
 
29
33
  yield self
30
- each do |child|
31
- child.walk(&block)
34
+
35
+ # Like #each, the next sibling is captured before a node is yielded, so
36
+ # the block may detach or replace the node it is given. `pending` holds
37
+ # the sibling to resume at once each ancestor's subtree is done.
38
+ pending = []
39
+ node = first_child
40
+ while node
41
+ next_node = node.next_sibling
42
+ yield node
43
+ pending << next_node if next_node
44
+ node = node.first_child || pending.pop
32
45
  end
33
46
  end
34
47
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmarker
4
- VERSION = "2.10.0"
4
+ VERSION = "2.10.1"
5
5
  end
data/lib/commonmarker.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "commonmarker/extension"
4
4
 
5
+ require "commonmarker/errors"
5
6
  require "commonmarker/utils"
6
7
  require "commonmarker/node"
7
8
  require "commonmarker/config"
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: 2.10.0
4
+ version: 2.10.1
5
5
  platform: x86_64-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: 2026-08-24 00:00:00.000000000 Z
12
+ date: 2026-10-16 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A fast, safe, extensible parser for CommonMark. This wraps the comrak
15
15
  Rust crate.
@@ -27,6 +27,7 @@ files:
27
27
  - lib/commonmarker/4.0/commonmarker.so
28
28
  - lib/commonmarker/config.rb
29
29
  - lib/commonmarker/constants.rb
30
+ - lib/commonmarker/errors.rb
30
31
  - lib/commonmarker/extension.rb
31
32
  - lib/commonmarker/node.rb
32
33
  - lib/commonmarker/node/ast.rb