commonmarker 2.8.3 → 2.9.0
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/Cargo.lock +18 -18
- data/README.md +2 -0
- data/ext/commonmarker/Cargo.toml +2 -2
- data/ext/commonmarker/src/node.rs +15 -3
- data/ext/commonmarker/src/options.rs +11 -0
- data/lib/commonmarker/config.rb +2 -0
- data/lib/commonmarker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 051a8f17a827d1329de0031ac4f933b3a78aee387707562979698f810bb64a87
|
|
4
|
+
data.tar.gz: e4f6e3c99d4c680db8d41f6d2bea08fb394db91cd628fed345a47c8b2f078e9f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dce8bf8e72268b9304ad04bc91d741be82f6e35de32a6914cacbce2be17b89ea1349c04dc45e83b06f91eeecb3eb36b697d099044b53926a1cafdb9bf7003894
|
|
7
|
+
data.tar.gz: 9dbcbfea2785a3e5567f605e0b96ff87e78cee59aa4219b524a55fd1d4241261acbc76fd5d3950565ca457795e0b957a3b19c5a27f6284eddce227de41653cff
|
data/Cargo.lock
CHANGED
|
@@ -82,9 +82,9 @@ dependencies = [
|
|
|
82
82
|
|
|
83
83
|
[[package]]
|
|
84
84
|
name = "cc"
|
|
85
|
-
version = "1.2.
|
|
85
|
+
version = "1.2.67"
|
|
86
86
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
87
|
-
checksum = "
|
|
87
|
+
checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38"
|
|
88
88
|
dependencies = [
|
|
89
89
|
"find-msvc-tools",
|
|
90
90
|
"shlex 2.0.1",
|
|
@@ -131,9 +131,9 @@ dependencies = [
|
|
|
131
131
|
|
|
132
132
|
[[package]]
|
|
133
133
|
name = "comrak"
|
|
134
|
-
version = "0.
|
|
134
|
+
version = "0.54.0"
|
|
135
135
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
136
|
-
checksum = "
|
|
136
|
+
checksum = "0d5910408554659ed848ff469e67ec83b30f179e72cec286cfdae64d1616f466"
|
|
137
137
|
dependencies = [
|
|
138
138
|
"caseless",
|
|
139
139
|
"emojis",
|
|
@@ -331,9 +331,9 @@ dependencies = [
|
|
|
331
331
|
|
|
332
332
|
[[package]]
|
|
333
333
|
name = "memchr"
|
|
334
|
-
version = "2.8.
|
|
334
|
+
version = "2.8.3"
|
|
335
335
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
336
|
-
checksum = "
|
|
336
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
337
337
|
|
|
338
338
|
[[package]]
|
|
339
339
|
name = "minimal-lexical"
|
|
@@ -442,9 +442,9 @@ checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"
|
|
|
442
442
|
|
|
443
443
|
[[package]]
|
|
444
444
|
name = "plist"
|
|
445
|
-
version = "1.
|
|
445
|
+
version = "1.10.0"
|
|
446
446
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
447
|
-
checksum = "
|
|
447
|
+
checksum = "7da1d65da6dd5d1e44199ac0f58712d241c0f439f80adea8924d832384087f85"
|
|
448
448
|
dependencies = [
|
|
449
449
|
"base64",
|
|
450
450
|
"indexmap",
|
|
@@ -470,9 +470,9 @@ dependencies = [
|
|
|
470
470
|
|
|
471
471
|
[[package]]
|
|
472
472
|
name = "quick-xml"
|
|
473
|
-
version = "0.
|
|
473
|
+
version = "0.41.0"
|
|
474
474
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
475
|
-
checksum = "
|
|
475
|
+
checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1"
|
|
476
476
|
dependencies = [
|
|
477
477
|
"memchr",
|
|
478
478
|
]
|
|
@@ -533,9 +533,9 @@ checksum = "e03e7866abec1101869ffa8e2c8355c4c2419d0214ece0cc3e428e5b94dea6e9"
|
|
|
533
533
|
|
|
534
534
|
[[package]]
|
|
535
535
|
name = "regex"
|
|
536
|
-
version = "1.
|
|
536
|
+
version = "1.13.0"
|
|
537
537
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
538
|
-
checksum = "
|
|
538
|
+
checksum = "2a0e75113e14dc5acb068cd0786884f214f1312650a3d36d269f5c4f3cdee8a2"
|
|
539
539
|
dependencies = [
|
|
540
540
|
"aho-corasick",
|
|
541
541
|
"memchr",
|
|
@@ -545,9 +545,9 @@ dependencies = [
|
|
|
545
545
|
|
|
546
546
|
[[package]]
|
|
547
547
|
name = "regex-automata"
|
|
548
|
-
version = "0.4.
|
|
548
|
+
version = "0.4.15"
|
|
549
549
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
550
|
-
checksum = "
|
|
550
|
+
checksum = "1f388202e4b80542a0921078cc23b6333bcf1409c1e3f86404cae4766a6131db"
|
|
551
551
|
dependencies = [
|
|
552
552
|
"aho-corasick",
|
|
553
553
|
"memchr",
|
|
@@ -562,9 +562,9 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
|
|
|
562
562
|
|
|
563
563
|
[[package]]
|
|
564
564
|
name = "rustc-hash"
|
|
565
|
-
version = "2.1.
|
|
565
|
+
version = "2.1.3"
|
|
566
566
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
567
|
-
checksum = "
|
|
567
|
+
checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
|
|
568
568
|
|
|
569
569
|
[[package]]
|
|
570
570
|
name = "same-file"
|
|
@@ -744,9 +744,9 @@ dependencies = [
|
|
|
744
744
|
|
|
745
745
|
[[package]]
|
|
746
746
|
name = "tinyvec"
|
|
747
|
-
version = "1.
|
|
747
|
+
version = "1.12.0"
|
|
748
748
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
749
|
-
checksum = "
|
|
749
|
+
checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f"
|
|
750
750
|
dependencies = [
|
|
751
751
|
"tinyvec_macros",
|
|
752
752
|
]
|
data/README.md
CHANGED
|
@@ -184,6 +184,7 @@ Note that there is a distinction in comrak for "parse" options and "render" opti
|
|
|
184
184
|
| `prefer_fenced` | Always output fenced code blocks, even where an indented one could be used. | `false` |
|
|
185
185
|
| `tasklist_classes` | Add CSS classes to the HTML output of the tasklist extension | `false` |
|
|
186
186
|
| `compact_html` | Suppress newlines in pretty-printed HTML output. | `false` |
|
|
187
|
+
| `alert_style` | The style of alert output: `"specific"` (`<div class="markdown-alert">`) or `"semantic"` (`<aside class="admonition">`). | `"specific"` |
|
|
187
188
|
|
|
188
189
|
As well, there are several extensions which you can toggle in the same manner:
|
|
189
190
|
|
|
@@ -212,6 +213,7 @@ Commonmarker.to_html('"Hi *there*"', options: {
|
|
|
212
213
|
| `front_matter_delimiter` | Enables the front matter extension. | `""` |
|
|
213
214
|
| `multiline_block_quotes` | Enables the multiline block quotes extension. | `false` |
|
|
214
215
|
| `math_dollars`, `math_code` | Enables the math extension. | `false` |
|
|
216
|
+
| `math_latex` | Enables the math extension with LaTeX-style delimiters (`\(inline\)`, `\[display\]`). | `false` |
|
|
215
217
|
| `shortcodes` | Enables the shortcodes extension. | `true` |
|
|
216
218
|
| `wikilinks_title_before_pipe` | Enables the wikilinks extension, placing the title before the dividing pipe. | `false` |
|
|
217
219
|
| `wikilinks_title_after_pipe` | Enables the wikilinks extension, placing the title after the dividing pipe. | `false` |
|
data/ext/commonmarker/Cargo.toml
CHANGED
|
@@ -21,7 +21,7 @@ syntect = { version = "5.3", default-features = false, features = [
|
|
|
21
21
|
|
|
22
22
|
# Everywhere except Windows: Oniguruma, the faster engine.
|
|
23
23
|
[target.'cfg(not(windows))'.dependencies]
|
|
24
|
-
comrak = { version = "0.
|
|
24
|
+
comrak = { version = "0.54", default-features = false, features = [
|
|
25
25
|
"shortcodes",
|
|
26
26
|
"syntect-onig",
|
|
27
27
|
] }
|
|
@@ -30,7 +30,7 @@ comrak = { version = "0.53", default-features = false, features = [
|
|
|
30
30
|
# linking a second copy (onig_sys) collides at link time and segfaults (xref #467).
|
|
31
31
|
# syntect-fancy swaps in the pure-Rust fancy-regex backend instead.
|
|
32
32
|
[target.'cfg(windows)'.dependencies]
|
|
33
|
-
comrak = { version = "0.
|
|
33
|
+
comrak = { version = "0.54", default-features = false, features = [
|
|
34
34
|
"shortcodes",
|
|
35
35
|
"syntect-fancy",
|
|
36
36
|
] }
|
|
@@ -40,19 +40,31 @@ impl CommonmarkerNode {
|
|
|
40
40
|
"document" => ComrakNodeValue::Document,
|
|
41
41
|
"block_quote" => ComrakNodeValue::BlockQuote,
|
|
42
42
|
"footnote_definition" => {
|
|
43
|
-
|
|
43
|
+
// HACK: For whatever reason, on i686, Ruby's `1` won't scan as
|
|
44
|
+
// Option<u32>, failing with "RangeError: fixnum too big to convert into `u32`".
|
|
45
|
+
// (Fixnum should be 31-bit on i686? Is this not fine?)
|
|
46
|
+
// Scanning as usize (or u64) works, so shrug and move on.
|
|
47
|
+
let kwargs = scan_args::get_kwargs::<_, (String,), (Option<usize>,), ()>(
|
|
44
48
|
args.keywords,
|
|
45
49
|
&["name"],
|
|
46
50
|
&["total_references"],
|
|
47
51
|
)?;
|
|
48
52
|
let (name,) = kwargs.required;
|
|
49
|
-
let (
|
|
53
|
+
let (total_references,) = kwargs.optional;
|
|
54
|
+
|
|
55
|
+
// HACK: Totally a u32 tho.
|
|
56
|
+
let Ok(total_references) = u32::try_from(total_references.unwrap_or(1)) else {
|
|
57
|
+
return Err(magnus::Error::new(
|
|
58
|
+
ruby.exception_range_error(),
|
|
59
|
+
"total_references too big to convert into `u32`",
|
|
60
|
+
));
|
|
61
|
+
};
|
|
50
62
|
|
|
51
63
|
ComrakNodeValue::FootnoteDefinition(NodeFootnoteDefinition {
|
|
52
64
|
// The name of the footnote.
|
|
53
65
|
name,
|
|
54
66
|
// Total number of references to this footnote
|
|
55
|
-
total_references
|
|
67
|
+
total_references,
|
|
56
68
|
})
|
|
57
69
|
}
|
|
58
70
|
"list" => {
|
|
@@ -58,6 +58,7 @@ const RENDER_GFM_QUIRKS: &str = "gfm_quirks";
|
|
|
58
58
|
const RENDER_PREFER_FENCED: &str = "prefer_fenced";
|
|
59
59
|
const RENDER_TASKLIST_CLASSES: &str = "tasklist_classes";
|
|
60
60
|
const RENDER_COMPACT_HTML: &str = "compact_html";
|
|
61
|
+
const RENDER_ALERT_STYLE: &str = "alert_style";
|
|
61
62
|
|
|
62
63
|
pub fn iterate_render_options(comrak_options: &mut comrak::options::Render, options_hash: RHash) {
|
|
63
64
|
options_hash
|
|
@@ -102,6 +103,12 @@ pub fn iterate_render_options(comrak_options: &mut comrak::options::Render, opti
|
|
|
102
103
|
Cow::Borrowed(RENDER_COMPACT_HTML) => {
|
|
103
104
|
comrak_options.compact_html = TryConvert::try_convert(value)?;
|
|
104
105
|
}
|
|
106
|
+
Cow::Borrowed(RENDER_ALERT_STYLE) => {
|
|
107
|
+
comrak_options.alert_style = match try_convert_string(value).as_deref() {
|
|
108
|
+
Some("semantic") => comrak::options::AlertStyleType::Semantic,
|
|
109
|
+
_ => comrak::options::AlertStyleType::Specific,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
105
112
|
_ => {}
|
|
106
113
|
}
|
|
107
114
|
Ok(ForEach::Continue)
|
|
@@ -124,6 +131,7 @@ const EXTENSION_FRONT_MATTER_DELIMITER: &str = "front_matter_delimiter";
|
|
|
124
131
|
const EXTENSION_MULTILINE_BLOCK_QUOTES: &str = "multiline_block_quotes";
|
|
125
132
|
const EXTENSION_MATH_DOLLARS: &str = "math_dollars";
|
|
126
133
|
const EXTENSION_MATH_CODE: &str = "math_code";
|
|
134
|
+
const EXTENSION_MATH_LATEX: &str = "math_latex";
|
|
127
135
|
const EXTENSION_SHORTCODES: &str = "shortcodes";
|
|
128
136
|
const EXTENSION_WIKILINKS_TITLE_AFTER_PIPE: &str = "wikilinks_title_after_pipe";
|
|
129
137
|
const EXTENSION_WIKILINKS_TITLE_BEFORE_PIPE: &str = "wikilinks_title_before_pipe";
|
|
@@ -194,6 +202,9 @@ pub fn iterate_extension_options(
|
|
|
194
202
|
Cow::Borrowed(EXTENSION_MATH_CODE) => {
|
|
195
203
|
comrak_options.math_code = TryConvert::try_convert(value)?;
|
|
196
204
|
}
|
|
205
|
+
Cow::Borrowed(EXTENSION_MATH_LATEX) => {
|
|
206
|
+
comrak_options.math_latex = TryConvert::try_convert(value)?;
|
|
207
|
+
}
|
|
197
208
|
Cow::Borrowed(EXTENSION_SHORTCODES) => {
|
|
198
209
|
comrak_options.shortcodes = TryConvert::try_convert(value)?;
|
|
199
210
|
}
|
data/lib/commonmarker/config.rb
CHANGED
|
@@ -28,6 +28,7 @@ module Commonmarker
|
|
|
28
28
|
prefer_fenced: false,
|
|
29
29
|
tasklist_classes: false,
|
|
30
30
|
compact_html: false,
|
|
31
|
+
alert_style: "specific",
|
|
31
32
|
}.freeze,
|
|
32
33
|
extension: {
|
|
33
34
|
strikethrough: true,
|
|
@@ -45,6 +46,7 @@ module Commonmarker
|
|
|
45
46
|
multiline_block_quotes: false,
|
|
46
47
|
math_dollars: false,
|
|
47
48
|
math_code: false,
|
|
49
|
+
math_latex: false,
|
|
48
50
|
shortcodes: true,
|
|
49
51
|
wikilinks_title_before_pipe: false,
|
|
50
52
|
wikilinks_title_after_pipe: false,
|
data/lib/commonmarker/version.rb
CHANGED