commonmarker 2.7.0 → 2.8.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 +10 -24
- data/Cargo.toml +6 -1
- data/README.md +6 -3
- data/ext/commonmarker/Cargo.toml +1 -1
- data/ext/commonmarker/build.rs +9 -0
- data/ext/commonmarker/src/options.rs +13 -1
- data/lib/commonmarker/config.rb +3 -0
- data/lib/commonmarker/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 362d4bf8294cd73e751f475c5b948bbec9d11aa7493f05ca10c92da121e9b70d
|
|
4
|
+
data.tar.gz: b2a32716e7715cc9cebc8924904f7f634ba545fd94e92bbcd0f5c90774ca5b9f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d0db7681ba488119f35f3c62b43b8e28f534e4e639ad9e19a37d8f40b9d191d456247ad4604d8e04f27e580ea3bffaa3ab5eed1b246956223d989c07daefb288
|
|
7
|
+
data.tar.gz: c62db4035c2ddeaf027cb231409f8a3814c393661609bbb75698c7ac4e01278a96a6e2225a48d9fd09633ea461a471df69b5d3b4232631b52374e7cf5a067f0d
|
data/Cargo.lock
CHANGED
|
@@ -84,20 +84,18 @@ dependencies = [
|
|
|
84
84
|
|
|
85
85
|
[[package]]
|
|
86
86
|
name = "bindgen"
|
|
87
|
-
version = "0.
|
|
87
|
+
version = "0.72.1"
|
|
88
88
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
89
|
-
checksum = "
|
|
89
|
+
checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
|
|
90
90
|
dependencies = [
|
|
91
91
|
"bitflags",
|
|
92
92
|
"cexpr",
|
|
93
93
|
"clang-sys",
|
|
94
94
|
"itertools",
|
|
95
|
-
"lazy_static",
|
|
96
|
-
"lazycell",
|
|
97
95
|
"proc-macro2",
|
|
98
96
|
"quote",
|
|
99
97
|
"regex",
|
|
100
|
-
"rustc-hash
|
|
98
|
+
"rustc-hash",
|
|
101
99
|
"shlex",
|
|
102
100
|
"syn",
|
|
103
101
|
]
|
|
@@ -255,9 +253,9 @@ dependencies = [
|
|
|
255
253
|
|
|
256
254
|
[[package]]
|
|
257
255
|
name = "comrak"
|
|
258
|
-
version = "0.
|
|
256
|
+
version = "0.52.0"
|
|
259
257
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
260
|
-
checksum = "
|
|
258
|
+
checksum = "aac0b255932a9cd52fbfd664b67957f9f2e095ae4711cb0e41b4e291edef94c2"
|
|
261
259
|
dependencies = [
|
|
262
260
|
"bon",
|
|
263
261
|
"caseless",
|
|
@@ -269,7 +267,7 @@ dependencies = [
|
|
|
269
267
|
"jetscii",
|
|
270
268
|
"phf",
|
|
271
269
|
"phf_codegen",
|
|
272
|
-
"rustc-hash
|
|
270
|
+
"rustc-hash",
|
|
273
271
|
"shell-words",
|
|
274
272
|
"smallvec",
|
|
275
273
|
"syntect",
|
|
@@ -484,12 +482,6 @@ version = "1.5.0"
|
|
|
484
482
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
485
483
|
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
|
486
484
|
|
|
487
|
-
[[package]]
|
|
488
|
-
name = "lazycell"
|
|
489
|
-
version = "1.3.0"
|
|
490
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
491
|
-
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
|
492
|
-
|
|
493
485
|
[[package]]
|
|
494
486
|
name = "libc"
|
|
495
487
|
version = "0.2.180"
|
|
@@ -725,18 +717,18 @@ dependencies = [
|
|
|
725
717
|
|
|
726
718
|
[[package]]
|
|
727
719
|
name = "rb-sys"
|
|
728
|
-
version = "0.9.
|
|
720
|
+
version = "0.9.126"
|
|
729
721
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
730
|
-
checksum = "
|
|
722
|
+
checksum = "284799e73e899fe946fd77c7211b83bff61a1356e039ade7a2516a779e3212d0"
|
|
731
723
|
dependencies = [
|
|
732
724
|
"rb-sys-build",
|
|
733
725
|
]
|
|
734
726
|
|
|
735
727
|
[[package]]
|
|
736
728
|
name = "rb-sys-build"
|
|
737
|
-
version = "0.9.
|
|
729
|
+
version = "0.9.126"
|
|
738
730
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
739
|
-
checksum = "
|
|
731
|
+
checksum = "855fc1ad8943d12c89ef12f9147f1cc531f5bf19fb744112fdd317bb6ee7b5c5"
|
|
740
732
|
dependencies = [
|
|
741
733
|
"bindgen",
|
|
742
734
|
"lazy_static",
|
|
@@ -788,12 +780,6 @@ version = "0.8.8"
|
|
|
788
780
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
789
781
|
checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
|
|
790
782
|
|
|
791
|
-
[[package]]
|
|
792
|
-
name = "rustc-hash"
|
|
793
|
-
version = "1.1.0"
|
|
794
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
795
|
-
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
|
796
|
-
|
|
797
783
|
[[package]]
|
|
798
784
|
name = "rustc-hash"
|
|
799
785
|
version = "2.1.1"
|
data/Cargo.toml
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# This Cargo.toml is here to let externals tools (IDEs, etc.) know that this is
|
|
2
|
-
# a Rust project. Your extensions
|
|
2
|
+
# a Rust project. Your extensions dependencies should be added to the Cargo.toml
|
|
3
3
|
# in the ext/ directory.
|
|
4
4
|
|
|
5
5
|
[workspace]
|
|
6
6
|
members = ["ext/commonmarker"]
|
|
7
7
|
resolver = "2"
|
|
8
|
+
|
|
9
|
+
[profile.release]
|
|
10
|
+
codegen-units = 1
|
|
11
|
+
lto = true
|
|
12
|
+
strip = true
|
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,
|
|
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.
|
|
9
9
|
>
|
|
10
10
|
> For more information on the available options and extensions, see [the documentation below](#options-and-plugins).
|
|
11
11
|
|
|
@@ -164,6 +164,7 @@ Note that there is a distinction in comrak for "parse" options and "render" opti
|
|
|
164
164
|
| `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` |
|
|
165
165
|
| `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` |
|
|
166
166
|
| `ignore_setext` | Ignores setext-style headings. | `false` |
|
|
167
|
+
| `sourcepos_chars` | Use character-based column tracking in source positions instead of byte-based. Relevant for multi-byte UTF-8 documents with `sourcepos`. | `false` |
|
|
167
168
|
|
|
168
169
|
### Render options
|
|
169
170
|
|
|
@@ -203,6 +204,7 @@ Commonmarker.to_html('"Hi *there*"', options: {
|
|
|
203
204
|
| `tasklist` | Enables the [task list extension](https://github.github.com/gfm/#task-list-items-extension-) from the GFM spec. | `true` |
|
|
204
205
|
| `superscript` | Enables the superscript Comrak extension. | `false` |
|
|
205
206
|
| `header_ids` | Enables the header IDs Comrak extension. from the GFM spec. | `""` |
|
|
207
|
+
| `header_id_prefix_in_href` | Also add the prefix to generated `href` attributes pointing to headers. | `false` |
|
|
206
208
|
| `footnotes` | Enables the footnotes extension per `cmark-gfm`. | `false` |
|
|
207
209
|
| `inline_footnotes` | Enables the inline footnotes extension. | `false` |
|
|
208
210
|
| `description_lists` | Enables the description lists extension. | `false` |
|
|
@@ -221,6 +223,7 @@ Commonmarker.to_html('"Hi *there*"', options: {
|
|
|
221
223
|
| `cjk_friendly_emphasis` | Enables the [CJK friendly emphasis](https://github.com/tats-u/markdown-cjk-friendly) extension. | `false` |
|
|
222
224
|
| `highlight` | Enables highlighting via `==` | `false` |
|
|
223
225
|
| `insert` | Enables the insert extension, rendering `++text++` as `<ins>text</ins>`. | `false` |
|
|
226
|
+
| `block_directive` | Enables the block directive extension. | `false` |
|
|
224
227
|
|
|
225
228
|
For more information on these options, see [the comrak documentation](https://github.com/kivikakk/comrak#usage).
|
|
226
229
|
|
|
@@ -231,6 +234,8 @@ providing further niceties.
|
|
|
231
234
|
|
|
232
235
|
#### Syntax Highlighter Plugin
|
|
233
236
|
|
|
237
|
+
The syntax highlighter plugin is **enabled by default**, using the `"base16-ocean.dark"` theme. It applies syntax highlighting to fenced code blocks that specify a language.
|
|
238
|
+
|
|
234
239
|
The library comes with [a set of pre-existing themes](https://docs.rs/syntect/5.0.0/syntect/highlighting/struct.ThemeSet.html#implementations) for highlighting code:
|
|
235
240
|
|
|
236
241
|
- `"base16-ocean.dark"`
|
|
@@ -261,8 +266,6 @@ puts Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "Inspire
|
|
|
261
266
|
# </code></pre>
|
|
262
267
|
````
|
|
263
268
|
|
|
264
|
-
By default, the plugin uses the `"base16-ocean.dark"` theme to syntax highlight code.
|
|
265
|
-
|
|
266
269
|
To disable this plugin, set the value to `nil`:
|
|
267
270
|
|
|
268
271
|
````ruby
|
data/ext/commonmarker/Cargo.toml
CHANGED
|
@@ -10,7 +10,7 @@ magnus = { version = "0.8", features = ["rb-sys"] }
|
|
|
10
10
|
rb-sys = { version = "*", default-features = false, features = [
|
|
11
11
|
"stable-api-compiled-fallback",
|
|
12
12
|
] }
|
|
13
|
-
comrak = { version = "0.
|
|
13
|
+
comrak = { version = "0.52", features = ["shortcodes"] }
|
|
14
14
|
syntect = { version = "5.3", features = ["plist-load"] }
|
|
15
15
|
typed-arena = "2.0"
|
|
16
16
|
rctree = "0.6"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
fn main() {
|
|
2
|
+
// Ruby statically bundles Oniguruma in its Windows library (libx64-ucrt-ruby*.a),
|
|
3
|
+
// which collides with onig_sys pulled in by comrak's syntect dependency.
|
|
4
|
+
// Allow the linker to resolve duplicates by picking the first definition.
|
|
5
|
+
let target = std::env::var("TARGET").unwrap_or_default();
|
|
6
|
+
if target.contains("windows-gnu") {
|
|
7
|
+
println!("cargo:rustc-link-arg=-Wl,--allow-multiple-definition");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -10,6 +10,7 @@ const PARSE_DEFAULT_INFO_STRING: &str = "default_info_string";
|
|
|
10
10
|
const PARSE_RELAXED_TASKLIST_MATCHING: &str = "relaxed_tasklist_matching";
|
|
11
11
|
const PARSE_RELAXED_AUTOLINKS: &str = "relaxed_autolinks";
|
|
12
12
|
const PARSE_LEAVE_FOOTNOTE_DEFINITIONS: &str = "leave_footnote_definitions";
|
|
13
|
+
const PARSE_SOURCEPOS_CHARS: &str = "sourcepos_chars";
|
|
13
14
|
|
|
14
15
|
pub fn iterate_parse_options(comrak_options: &mut comrak::options::Parse, options_hash: RHash) {
|
|
15
16
|
options_hash
|
|
@@ -33,6 +34,9 @@ pub fn iterate_parse_options(comrak_options: &mut comrak::options::Parse, option
|
|
|
33
34
|
Cow::Borrowed(PARSE_LEAVE_FOOTNOTE_DEFINITIONS) => {
|
|
34
35
|
comrak_options.leave_footnote_definitions = TryConvert::try_convert(value)?;
|
|
35
36
|
}
|
|
37
|
+
Cow::Borrowed(PARSE_SOURCEPOS_CHARS) => {
|
|
38
|
+
comrak_options.sourcepos_chars = TryConvert::try_convert(value)?;
|
|
39
|
+
}
|
|
36
40
|
_ => {}
|
|
37
41
|
}
|
|
38
42
|
Ok(ForEach::Continue)
|
|
@@ -112,6 +116,7 @@ const EXTENSION_AUTOLINK: &str = "autolink";
|
|
|
112
116
|
const EXTENSION_TASKLIST: &str = "tasklist";
|
|
113
117
|
const EXTENSION_SUPERSCRIPT: &str = "superscript";
|
|
114
118
|
const EXTENSION_HEADER_IDS: &str = "header_ids";
|
|
119
|
+
const EXTENSION_HEADER_ID_PREFIX_IN_HREF: &str = "header_id_prefix_in_href";
|
|
115
120
|
const EXTENSION_FOOTNOTES: &str = "footnotes";
|
|
116
121
|
const EXTENSION_INLINE_FOOTNOTES: &str = "inline_footnotes";
|
|
117
122
|
const EXTENSION_DESCRIPTION_LISTS: &str = "description_lists";
|
|
@@ -131,6 +136,7 @@ const EXTENSION_ALERTS: &str = "alerts";
|
|
|
131
136
|
const EXTENSION_CJK_FRIENDLY_EMPHASIS: &str = "cjk_friendly_emphasis";
|
|
132
137
|
const EXTENSION_HIGHLIGHT: &str = "highlight";
|
|
133
138
|
const EXTENSION_INSERT: &str = "insert";
|
|
139
|
+
const EXTENSION_BLOCK_DIRECTIVE: &str = "block_directive";
|
|
134
140
|
|
|
135
141
|
pub fn iterate_extension_options(
|
|
136
142
|
comrak_options: &mut comrak::options::Extension,
|
|
@@ -158,7 +164,10 @@ pub fn iterate_extension_options(
|
|
|
158
164
|
comrak_options.superscript = TryConvert::try_convert(value)?;
|
|
159
165
|
}
|
|
160
166
|
Cow::Borrowed(EXTENSION_HEADER_IDS) => {
|
|
161
|
-
comrak_options.
|
|
167
|
+
comrak_options.header_id_prefix = try_convert_string(value);
|
|
168
|
+
}
|
|
169
|
+
Cow::Borrowed(EXTENSION_HEADER_ID_PREFIX_IN_HREF) => {
|
|
170
|
+
comrak_options.header_id_prefix_in_href = TryConvert::try_convert(value)?;
|
|
162
171
|
}
|
|
163
172
|
Cow::Borrowed(EXTENSION_FOOTNOTES) => {
|
|
164
173
|
comrak_options.footnotes = TryConvert::try_convert(value)?;
|
|
@@ -221,6 +230,9 @@ pub fn iterate_extension_options(
|
|
|
221
230
|
Cow::Borrowed(EXTENSION_INSERT) => {
|
|
222
231
|
comrak_options.insert = TryConvert::try_convert(value)?;
|
|
223
232
|
}
|
|
233
|
+
Cow::Borrowed(EXTENSION_BLOCK_DIRECTIVE) => {
|
|
234
|
+
comrak_options.block_directive = TryConvert::try_convert(value)?;
|
|
235
|
+
}
|
|
224
236
|
_ => {}
|
|
225
237
|
}
|
|
226
238
|
Ok(ForEach::Continue)
|
data/lib/commonmarker/config.rb
CHANGED
|
@@ -12,6 +12,7 @@ module Commonmarker
|
|
|
12
12
|
relaxed_autolinks: false,
|
|
13
13
|
leave_footnote_definitions: false,
|
|
14
14
|
ignore_setext: false,
|
|
15
|
+
sourcepos_chars: false,
|
|
15
16
|
}.freeze,
|
|
16
17
|
render: {
|
|
17
18
|
hardbreaks: true,
|
|
@@ -36,6 +37,7 @@ module Commonmarker
|
|
|
36
37
|
tasklist: true,
|
|
37
38
|
superscript: false,
|
|
38
39
|
header_ids: "",
|
|
40
|
+
header_id_prefix_in_href: false,
|
|
39
41
|
footnotes: false,
|
|
40
42
|
inline_footnotes: false,
|
|
41
43
|
description_lists: false,
|
|
@@ -55,6 +57,7 @@ module Commonmarker
|
|
|
55
57
|
cjk_friendly_emphasis: false,
|
|
56
58
|
highlight: false,
|
|
57
59
|
insert: false,
|
|
60
|
+
block_directive: false,
|
|
58
61
|
}.freeze,
|
|
59
62
|
format: [:html].freeze,
|
|
60
63
|
}.freeze
|
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.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Garen Torikian
|
|
@@ -64,6 +64,7 @@ files:
|
|
|
64
64
|
- LICENSE.txt
|
|
65
65
|
- README.md
|
|
66
66
|
- ext/commonmarker/Cargo.toml
|
|
67
|
+
- ext/commonmarker/build.rs
|
|
67
68
|
- ext/commonmarker/extconf.rb
|
|
68
69
|
- ext/commonmarker/src/lib.rs
|
|
69
70
|
- ext/commonmarker/src/node.rs
|
|
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
106
107
|
- !ruby/object:Gem::Version
|
|
107
108
|
version: '3.4'
|
|
108
109
|
requirements: []
|
|
109
|
-
rubygems_version: 4.0.
|
|
110
|
+
rubygems_version: 4.0.6
|
|
110
111
|
specification_version: 4
|
|
111
112
|
summary: CommonMark parser and renderer. Written in Rust, wrapped in Ruby.
|
|
112
113
|
test_files: []
|