commonmarker 2.9.0-x86_64-linux → 2.10.0-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 +4 -4
- data/README.md +33 -15
- 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 +2 -2
- data/lib/commonmarker/node/inspect.rb +2 -4
- data/lib/commonmarker/node.rb +12 -0
- data/lib/commonmarker/version.rb +1 -1
- metadata +3 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ce6b951b17bb332437fd707359b206756948e4c71a1446aef9b2e1466622e43
|
|
4
|
+
data.tar.gz: 129ae692bbaa24696a7ef0900dad2cae399631e9d26f3f038eb900792b5ffce9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71fde760c2ac2d8035b0090e7b0270e1f0147bc66d5a05b157a54248b630107ac0e299453fed9fa2269d6c1be97ade2788f40790e15c0b77cf8d837b70795ffa
|
|
7
|
+
data.tar.gz: 0b3c60142ac4e0b9440c4a08f3ed7fde610f27615438b638eb98349142df89dbaf51b62a4faae051cf176f54b93b7bce28893ee94ed12a00fc04eaca827434dd
|
data/README.md
CHANGED
|
@@ -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
|
|
@@ -169,21 +187,21 @@ Note that there is a distinction in comrak for "parse" options and "render" opti
|
|
|
169
187
|
|
|
170
188
|
### Render options
|
|
171
189
|
|
|
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.
|
|
190
|
+
| Name | Description | Default |
|
|
191
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------ |
|
|
192
|
+
| `hardbreaks` | [Soft line breaks](http://spec.commonmark.org/0.27/#soft-line-breaks) translate into hard line breaks. | `true` |
|
|
193
|
+
| `github_pre_lang` | GitHub-style `<pre lang="xyz">` is used for fenced code blocks with info tags. | `true` |
|
|
194
|
+
| `full_info_string` | Gives info string data after a space in a `data-meta` attribute on code blocks. | `false` |
|
|
195
|
+
| `width` | The wrap column when outputting CommonMark. | `80` |
|
|
196
|
+
| `unsafe` | Allow rendering of raw HTML and potentially dangerous links. | `false` |
|
|
197
|
+
| `escape` | Escape raw HTML instead of clobbering it. | `false` |
|
|
198
|
+
| `sourcepos` | Include source position attribute in HTML and XML output. | `false` |
|
|
199
|
+
| `escaped_char_spans` | Wrap escaped characters in span tags. | `true` |
|
|
200
|
+
| `ignore_empty_links` | Ignores empty links, leaving the Markdown text in place. | `false` |
|
|
201
|
+
| `gfm_quirks` | Outputs HTML with GFM-style quirks; namely, not nesting `<strong>` inlines. | `false` |
|
|
202
|
+
| `prefer_fenced` | Always output fenced code blocks, even where an indented one could be used. | `false` |
|
|
203
|
+
| `tasklist_classes` | Add CSS classes to the HTML output of the tasklist extension | `false` |
|
|
204
|
+
| `compact_html` | Suppress newlines in pretty-printed HTML output. | `false` |
|
|
187
205
|
| `alert_style` | The style of alert output: `"specific"` (`<div class="markdown-alert">`) or `"semantic"` (`<aside class="admonition">`). | `"specific"` |
|
|
188
206
|
|
|
189
207
|
As well, there are several extensions which you can toggle in the same manner:
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/commonmarker/config.rb
CHANGED
|
@@ -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,6 +8,18 @@ module Commonmarker
|
|
|
8
8
|
include Enumerable
|
|
9
9
|
include Inspect
|
|
10
10
|
|
|
11
|
+
# Public: Whether this node responds to the given method.
|
|
12
|
+
#
|
|
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
|
+
|
|
11
23
|
# Public: An iterator that "walks the tree," descending into children recursively.
|
|
12
24
|
#
|
|
13
25
|
# blk - A {Proc} representing the action to take for each child
|
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: 2.
|
|
4
|
+
version: 2.10.0
|
|
5
5
|
platform: x86_64-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-08-24 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:
|