commonmarker 2.9.0-aarch64-linux → 2.10.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 +35 -17
- data/lib/commonmarker/3.2/commonmarker.so +0 -0
- data/lib/commonmarker/3.3/commonmarker.so +0 -0
- data/lib/commonmarker/3.4/commonmarker.so +0 -0
- data/lib/commonmarker/4.0/commonmarker.so +0 -0
- data/lib/commonmarker/config.rb +3 -3
- data/lib/commonmarker/errors.rb +7 -0
- data/lib/commonmarker/node/inspect.rb +2 -4
- data/lib/commonmarker/node.rb +29 -4
- data/lib/commonmarker/version.rb +1 -1
- data/lib/commonmarker.rb +1 -0
- metadata +4 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f6fcc312c1bc820c8d1358f1c294020e71be9f0c7e0123d5145a511c0a9f7379
|
|
4
|
+
data.tar.gz: 41a2f9aee62a4ea199121f1220846f3cb0b885368350d310a4060b30a3e25667
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3821aed6a01a1b9b6fd870e9583f11e80c06e96db157df9de18063504c1aac842ee970bc7ec69c6ae08437bfbf34876393f0d09a157d3914992725e45e13f70
|
|
7
|
+
data.tar.gz: 5430cb7ce30b259835d0c53279e70d94fb46a4d8d71659f24acc1a00a9d9036994ddc6a128b3d93fbd5d9e9ea0773835e7f1277eebac61d5e6a381f3839c9651
|
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`, `
|
|
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
|
|
|
@@ -140,6 +140,24 @@ doc.to_commonmark
|
|
|
140
140
|
# => # The site\n\nGitHub\n
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
+
### Reading and writing node content
|
|
144
|
+
|
|
145
|
+
`string_content` reads and writes the text of nodes whose content is plain text (like `:text`, `:code`, and `:code_block`).
|
|
146
|
+
|
|
147
|
+
`literal` reads and writes the raw string a node carries, for every node type that has one (like `:text`, `:code`, `:code_block`, `:html_block`, `:html_inline`, `:raw`, `:math`, and `:frontmatter`).
|
|
148
|
+
|
|
149
|
+
The two exist separately because they mean different things. Rewriting `string_content` only ever swaps text for text. Rewriting `literal` on an `:html_block`, `:html_inline`, or `:raw` node writes markup that is emitted unescaped:
|
|
150
|
+
|
|
151
|
+
```ruby
|
|
152
|
+
doc = Commonmarker.parse("A <b>bold</b> claim")
|
|
153
|
+
|
|
154
|
+
doc.walk do |node|
|
|
155
|
+
node.literal = "<i>" if node.type == :html_inline && node.literal == "<b>"
|
|
156
|
+
end
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Note that a `:frontmatter` node's literal includes its delimiters and trailing newlines, so anything you assign must include them too.
|
|
160
|
+
|
|
143
161
|
## Options and plugins
|
|
144
162
|
|
|
145
163
|
### Options
|
|
@@ -166,24 +184,25 @@ Note that there is a distinction in comrak for "parse" options and "render" opti
|
|
|
166
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` |
|
|
167
185
|
| `ignore_setext` | Ignores setext-style headings. | `false` |
|
|
168
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` |
|
|
169
188
|
|
|
170
189
|
### Render options
|
|
171
190
|
|
|
172
|
-
| Name | Description
|
|
173
|
-
| -------------------- |
|
|
174
|
-
| `hardbreaks` | [Soft line breaks](http://spec.commonmark.org/0.27/#soft-line-breaks) translate into hard line breaks.
|
|
175
|
-
| `github_pre_lang` | GitHub-style `<pre lang="xyz">` is used for fenced code blocks with info tags.
|
|
176
|
-
| `full_info_string` | Gives info string data after a space in a `data-meta` attribute on code blocks.
|
|
177
|
-
| `width` | The wrap column when outputting CommonMark.
|
|
178
|
-
| `unsafe` | Allow rendering of raw HTML and potentially dangerous links.
|
|
179
|
-
| `escape` | Escape raw HTML instead of clobbering it.
|
|
180
|
-
| `sourcepos` | Include source position attribute in HTML and XML output.
|
|
181
|
-
| `escaped_char_spans` | Wrap escaped characters in span tags.
|
|
182
|
-
| `ignore_empty_links` | Ignores empty links, leaving the Markdown text in place.
|
|
183
|
-
| `gfm_quirks` | Outputs HTML with GFM-style quirks; namely, not nesting `<strong>` inlines.
|
|
184
|
-
| `prefer_fenced` | Always output fenced code blocks, even where an indented one could be used.
|
|
185
|
-
| `tasklist_classes` | Add CSS classes to the HTML output of the tasklist extension
|
|
186
|
-
| `compact_html` | Suppress newlines in pretty-printed HTML output.
|
|
191
|
+
| Name | Description | Default |
|
|
192
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------ |
|
|
193
|
+
| `hardbreaks` | [Soft line breaks](http://spec.commonmark.org/0.27/#soft-line-breaks) translate into hard line breaks. | `true` |
|
|
194
|
+
| `github_pre_lang` | GitHub-style `<pre lang="xyz">` is used for fenced code blocks with info tags. | `true` |
|
|
195
|
+
| `full_info_string` | Gives info string data after a space in a `data-meta` attribute on code blocks. | `false` |
|
|
196
|
+
| `width` | The wrap column when outputting CommonMark. | `80` |
|
|
197
|
+
| `unsafe` | Allow rendering of raw HTML and potentially dangerous links. | `false` |
|
|
198
|
+
| `escape` | Escape raw HTML instead of clobbering it. | `false` |
|
|
199
|
+
| `sourcepos` | Include source position attribute in HTML and XML output. | `false` |
|
|
200
|
+
| `escaped_char_spans` | Wrap escaped characters in span tags. | `true` |
|
|
201
|
+
| `ignore_empty_links` | Ignores empty links, leaving the Markdown text in place. | `false` |
|
|
202
|
+
| `gfm_quirks` | Outputs HTML with GFM-style quirks; namely, not nesting `<strong>` inlines. | `false` |
|
|
203
|
+
| `prefer_fenced` | Always output fenced code blocks, even where an indented one could be used. | `false` |
|
|
204
|
+
| `tasklist_classes` | Add CSS classes to the HTML output of the tasklist extension | `false` |
|
|
205
|
+
| `compact_html` | Suppress newlines in pretty-printed HTML output. | `false` |
|
|
187
206
|
| `alert_style` | The style of alert output: `"specific"` (`<div class="markdown-alert">`) or `"semantic"` (`<aside class="admonition">`). | `"specific"` |
|
|
188
207
|
|
|
189
208
|
As well, there are several extensions which you can toggle in the same manner:
|
|
@@ -200,7 +219,6 @@ Commonmarker.to_html('"Hi *there*"', options: {
|
|
|
200
219
|
| Name | Description | Default |
|
|
201
220
|
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
202
221
|
| `strikethrough` | Enables the [strikethrough extension](https://github.github.com/gfm/#strikethrough-extension-) from the GFM spec. | `true` |
|
|
203
|
-
| `tagfilter` | Enables the [tagfilter extension](https://github.github.com/gfm/#disallowed-raw-html-extension-) from the GFM spec. | `true` |
|
|
204
222
|
| `table` | Enables the [table extension](https://github.github.com/gfm/#tables-extension-) from the GFM spec. | `true` |
|
|
205
223
|
| `autolink` | Enables the [autolink extension](https://github.github.com/gfm/#autolinks-extension-) from the GFM spec. | `true` |
|
|
206
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
|
data/lib/commonmarker/config.rb
CHANGED
|
@@ -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,
|
|
@@ -68,8 +68,8 @@ module Commonmarker
|
|
|
68
68
|
syntax_highlighter: {
|
|
69
69
|
theme: "base16-ocean.dark",
|
|
70
70
|
path: "",
|
|
71
|
-
},
|
|
72
|
-
}
|
|
71
|
+
}.freeze,
|
|
72
|
+
}.freeze
|
|
73
73
|
|
|
74
74
|
class << self
|
|
75
75
|
include Commonmarker::Utils
|
|
@@ -28,10 +28,8 @@ module Commonmarker
|
|
|
28
28
|
:fence_info,
|
|
29
29
|
:alert_type,
|
|
30
30
|
].filter_map do |name|
|
|
31
|
-
[name, __send__(name)]
|
|
32
|
-
|
|
33
|
-
nil
|
|
34
|
-
end.compact
|
|
31
|
+
[name, __send__(name)] if respond_to?(name)
|
|
32
|
+
end
|
|
35
33
|
|
|
36
34
|
printer.seplist(attrs) do |name, value|
|
|
37
35
|
printer.text("#{name}=")
|
data/lib/commonmarker/node.rb
CHANGED
|
@@ -8,15 +8,40 @@ module Commonmarker
|
|
|
8
8
|
include Enumerable
|
|
9
9
|
include Inspect
|
|
10
10
|
|
|
11
|
-
# Public:
|
|
11
|
+
# Public: Whether this node responds to the given method.
|
|
12
12
|
#
|
|
13
|
-
#
|
|
13
|
+
# name - A {Symbol} or {String} naming the method.
|
|
14
|
+
# include_all - A {Boolean} indicating whether to consider private methods.
|
|
15
|
+
#
|
|
16
|
+
# Returns a {Boolean}.
|
|
17
|
+
def respond_to?(name, include_all = false)
|
|
18
|
+
return false if node_supports?(name.to_sym) == false
|
|
19
|
+
|
|
20
|
+
super
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Public: An iterator that "walks the tree," yielding each node and then
|
|
24
|
+
# its descendants, in document order.
|
|
25
|
+
#
|
|
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
|
|
14
30
|
def walk(&block)
|
|
15
31
|
return enum_for(:walk) unless block
|
|
16
32
|
|
|
17
33
|
yield self
|
|
18
|
-
|
|
19
|
-
|
|
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
|
|
20
45
|
end
|
|
21
46
|
end
|
|
22
47
|
|
data/lib/commonmarker/version.rb
CHANGED
data/lib/commonmarker.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: 2.
|
|
4
|
+
version: 2.10.1
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Garen Torikian
|
|
@@ -9,36 +9,8 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-
|
|
13
|
-
dependencies:
|
|
14
|
-
- !ruby/object:Gem::Dependency
|
|
15
|
-
name: rake
|
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
requirements:
|
|
18
|
-
- - "~>"
|
|
19
|
-
- !ruby/object:Gem::Version
|
|
20
|
-
version: '13.0'
|
|
21
|
-
type: :development
|
|
22
|
-
prerelease: false
|
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
24
|
-
requirements:
|
|
25
|
-
- - "~>"
|
|
26
|
-
- !ruby/object:Gem::Version
|
|
27
|
-
version: '13.0'
|
|
28
|
-
- !ruby/object:Gem::Dependency
|
|
29
|
-
name: rake-compiler
|
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
|
31
|
-
requirements:
|
|
32
|
-
- - "~>"
|
|
33
|
-
- !ruby/object:Gem::Version
|
|
34
|
-
version: '1.2'
|
|
35
|
-
type: :development
|
|
36
|
-
prerelease: false
|
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
38
|
-
requirements:
|
|
39
|
-
- - "~>"
|
|
40
|
-
- !ruby/object:Gem::Version
|
|
41
|
-
version: '1.2'
|
|
12
|
+
date: 2026-10-16 00:00:00.000000000 Z
|
|
13
|
+
dependencies: []
|
|
42
14
|
description: A fast, safe, extensible parser for CommonMark. This wraps the comrak
|
|
43
15
|
Rust crate.
|
|
44
16
|
email:
|
|
@@ -55,6 +27,7 @@ files:
|
|
|
55
27
|
- lib/commonmarker/4.0/commonmarker.so
|
|
56
28
|
- lib/commonmarker/config.rb
|
|
57
29
|
- lib/commonmarker/constants.rb
|
|
30
|
+
- lib/commonmarker/errors.rb
|
|
58
31
|
- lib/commonmarker/extension.rb
|
|
59
32
|
- lib/commonmarker/node.rb
|
|
60
33
|
- lib/commonmarker/node/ast.rb
|