commonmarker 2.6.3 → 2.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe0a8d460b6c55f6ac1d7a04df66e096327dd86bb36f90dabc0f5831b9b04c7c
4
- data.tar.gz: 45b232a82f72ecd1ea3a8f5f61c41d394494570cf562ae9bc162dcba95751112
3
+ metadata.gz: e957581f95994879ef4f49e98c8103ff5e6aa5c8ececb7b4e36aff6c720d2291
4
+ data.tar.gz: 2424ac822e2d46c3d87a534fea610aa3826cf979c556cb57018407bee815b3a5
5
5
  SHA512:
6
- metadata.gz: 3e30e85a5bb4dbbeabb14024093d4a85118b73553288f7e2969e6464e114785d4b89d0bc7fd9c39efd2df5736257aa9fbfcad166fa4d64403817af519faaf94b
7
- data.tar.gz: ff6cb1383f0d5711ede179b1ace7b8c4c7a2580e2ed90617a7ea701bd7e59cdd7d47baeaf1f9bbbb051c204272ff48577d70e90430f9eb840b6ae53d09fe0943
6
+ metadata.gz: ba981be34c92dc9fe4d93b22d03f77406e64f53a02db8f5aa6c87a86bebafd2fbe34384ae68561a6f59d92b4f83369407dd6becf15f0a2c03c2a6dab0ecf726b
7
+ data.tar.gz: 2217743311c62f65885e8e842f422357f2b923f717f4cc8af9f7f285eded1539b1fba4e60faed00e25c5ccece3210bf0a79afeeb9e8499b18d21e8e9c708f22c
data/Cargo.lock CHANGED
@@ -97,7 +97,7 @@ dependencies = [
97
97
  "proc-macro2",
98
98
  "quote",
99
99
  "regex",
100
- "rustc-hash",
100
+ "rustc-hash 1.1.0",
101
101
  "shlex",
102
102
  "syn",
103
103
  ]
@@ -255,21 +255,25 @@ dependencies = [
255
255
 
256
256
  [[package]]
257
257
  name = "comrak"
258
- version = "0.49.0"
258
+ version = "0.51.0"
259
259
  source = "registry+https://github.com/rust-lang/crates.io-index"
260
- checksum = "ab87129dce2f2d7e75e753b1df0e5093b27dec8fa5970b6eb51280faacb25bd6"
260
+ checksum = "9f07383e7799d964bf7ffa6fc4457d177c54a44614661c7458bb0bd91b108e32"
261
261
  dependencies = [
262
262
  "bon",
263
263
  "caseless",
264
264
  "clap",
265
265
  "emojis",
266
266
  "entities",
267
+ "finl_unicode",
267
268
  "fmt2io",
268
269
  "jetscii",
270
+ "phf",
271
+ "phf_codegen",
272
+ "rustc-hash 2.1.1",
269
273
  "shell-words",
274
+ "smallvec",
270
275
  "syntect",
271
276
  "typed-arena",
272
- "unicode_categories",
273
277
  "xdg",
274
278
  ]
275
279
 
@@ -333,9 +337,9 @@ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
333
337
 
334
338
  [[package]]
335
339
  name = "emojis"
336
- version = "0.6.4"
340
+ version = "0.8.0"
337
341
  source = "registry+https://github.com/rust-lang/crates.io-index"
338
- checksum = "99e1f1df1f181f2539bac8bf027d31ca5ffbf9e559e3f2d09413b9107b5c02f4"
342
+ checksum = "50c1c1870b766fc398e5f0526498d09c94b6de15be5fd769a28bbc804fb1b05d"
339
343
  dependencies = [
340
344
  "phf",
341
345
  ]
@@ -373,12 +377,24 @@ dependencies = [
373
377
  "regex-syntax",
374
378
  ]
375
379
 
380
+ [[package]]
381
+ name = "fastrand"
382
+ version = "2.3.0"
383
+ source = "registry+https://github.com/rust-lang/crates.io-index"
384
+ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
385
+
376
386
  [[package]]
377
387
  name = "find-msvc-tools"
378
388
  version = "0.1.8"
379
389
  source = "registry+https://github.com/rust-lang/crates.io-index"
380
390
  checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
381
391
 
392
+ [[package]]
393
+ name = "finl_unicode"
394
+ version = "1.4.0"
395
+ source = "registry+https://github.com/rust-lang/crates.io-index"
396
+ checksum = "9844ddc3a6e533d62bba727eb6c28b5d360921d5175e9ff0f1e621a5c590a4d5"
397
+
382
398
  [[package]]
383
399
  name = "flate2"
384
400
  version = "1.1.8"
@@ -559,9 +575,9 @@ dependencies = [
559
575
 
560
576
  [[package]]
561
577
  name = "num-conv"
562
- version = "0.1.0"
578
+ version = "0.2.0"
563
579
  source = "registry+https://github.com/rust-lang/crates.io-index"
564
- checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
580
+ checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
565
581
 
566
582
  [[package]]
567
583
  name = "once_cell"
@@ -599,18 +615,39 @@ dependencies = [
599
615
 
600
616
  [[package]]
601
617
  name = "phf"
602
- version = "0.11.3"
618
+ version = "0.13.1"
619
+ source = "registry+https://github.com/rust-lang/crates.io-index"
620
+ checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
621
+ dependencies = [
622
+ "phf_shared",
623
+ "serde",
624
+ ]
625
+
626
+ [[package]]
627
+ name = "phf_codegen"
628
+ version = "0.13.1"
629
+ source = "registry+https://github.com/rust-lang/crates.io-index"
630
+ checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
631
+ dependencies = [
632
+ "phf_generator",
633
+ "phf_shared",
634
+ ]
635
+
636
+ [[package]]
637
+ name = "phf_generator"
638
+ version = "0.13.1"
603
639
  source = "registry+https://github.com/rust-lang/crates.io-index"
604
- checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
640
+ checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
605
641
  dependencies = [
642
+ "fastrand",
606
643
  "phf_shared",
607
644
  ]
608
645
 
609
646
  [[package]]
610
647
  name = "phf_shared"
611
- version = "0.11.3"
648
+ version = "0.13.1"
612
649
  source = "registry+https://github.com/rust-lang/crates.io-index"
613
- checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
650
+ checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
614
651
  dependencies = [
615
652
  "siphasher",
616
653
  ]
@@ -757,6 +794,12 @@ version = "1.1.0"
757
794
  source = "registry+https://github.com/rust-lang/crates.io-index"
758
795
  checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
759
796
 
797
+ [[package]]
798
+ name = "rustc-hash"
799
+ version = "2.1.1"
800
+ source = "registry+https://github.com/rust-lang/crates.io-index"
801
+ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
802
+
760
803
  [[package]]
761
804
  name = "rustix"
762
805
  version = "1.1.3"
@@ -857,6 +900,12 @@ version = "1.0.1"
857
900
  source = "registry+https://github.com/rust-lang/crates.io-index"
858
901
  checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
859
902
 
903
+ [[package]]
904
+ name = "smallvec"
905
+ version = "1.15.1"
906
+ source = "registry+https://github.com/rust-lang/crates.io-index"
907
+ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
908
+
860
909
  [[package]]
861
910
  name = "strsim"
862
911
  version = "0.11.1"
@@ -928,9 +977,9 @@ dependencies = [
928
977
 
929
978
  [[package]]
930
979
  name = "time"
931
- version = "0.3.45"
980
+ version = "0.3.47"
932
981
  source = "registry+https://github.com/rust-lang/crates.io-index"
933
- checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd"
982
+ checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c"
934
983
  dependencies = [
935
984
  "deranged",
936
985
  "itoa",
@@ -943,15 +992,15 @@ dependencies = [
943
992
 
944
993
  [[package]]
945
994
  name = "time-core"
946
- version = "0.1.7"
995
+ version = "0.1.8"
947
996
  source = "registry+https://github.com/rust-lang/crates.io-index"
948
- checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca"
997
+ checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"
949
998
 
950
999
  [[package]]
951
1000
  name = "time-macros"
952
- version = "0.2.25"
1001
+ version = "0.2.27"
953
1002
  source = "registry+https://github.com/rust-lang/crates.io-index"
954
- checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd"
1003
+ checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215"
955
1004
  dependencies = [
956
1005
  "num-conv",
957
1006
  "time-core",
@@ -993,12 +1042,6 @@ dependencies = [
993
1042
  "tinyvec",
994
1043
  ]
995
1044
 
996
- [[package]]
997
- name = "unicode_categories"
998
- version = "0.1.1"
999
- source = "registry+https://github.com/rust-lang/crates.io-index"
1000
- checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
1001
-
1002
1045
  [[package]]
1003
1046
  name = "utf8parse"
1004
1047
  version = "0.2.2"
@@ -1115,9 +1158,9 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
1115
1158
 
1116
1159
  [[package]]
1117
1160
  name = "xdg"
1118
- version = "2.5.2"
1161
+ version = "3.0.0"
1119
1162
  source = "registry+https://github.com/rust-lang/crates.io-index"
1120
- checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546"
1163
+ checksum = "2fb433233f2df9344722454bc7e96465c9d03bff9d77c248f9e7523fe79585b5"
1121
1164
 
1122
1165
  [[package]]
1123
1166
  name = "yaml-rust"
data/README.md CHANGED
@@ -181,6 +181,7 @@ Note that there is a distinction in comrak for "parse" options and "render" opti
181
181
  | `gfm_quirks` | Outputs HTML with GFM-style quirks; namely, not nesting `<strong>` inlines. | `false` |
182
182
  | `prefer_fenced` | Always output fenced code blocks, even where an indented one could be used. | `false` |
183
183
  | `tasklist_classes` | Add CSS classes to the HTML output of the tasklist extension | `false` |
184
+ | `compact_html` | Suppress newlines in pretty-printed HTML output. | `false` |
184
185
 
185
186
  As well, there are several extensions which you can toggle in the same manner:
186
187
 
@@ -219,6 +220,7 @@ Commonmarker.to_html('"Hi *there*"', options: {
219
220
  | `alerts` | Enables the alerts extension. | `false` |
220
221
  | `cjk_friendly_emphasis` | Enables the [CJK friendly emphasis](https://github.com/tats-u/markdown-cjk-friendly) extension. | `false` |
221
222
  | `highlight` | Enables highlighting via `==` | `false` |
223
+ | `insert` | Enables the insert extension, rendering `++text++` as `<ins>text</ins>`. | `false` |
222
224
 
223
225
  For more information on these options, see [the comrak documentation](https://github.com/kivikakk/comrak#usage).
224
226
 
@@ -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.49", features = ["shortcodes"] }
13
+ comrak = { version = "0.51", features = ["shortcodes"] }
14
14
  syntect = { version = "5.3", features = ["plist-load"] }
15
15
  typed-arena = "2.0"
16
16
  rctree = "0.6"
@@ -922,6 +922,33 @@ impl CommonmarkerNode {
922
922
  }
923
923
  }
924
924
 
925
+ fn get_fenced(ruby: &Ruby, rb_self: &Self) -> Result<bool, magnus::Error> {
926
+ let node = rb_self.inner.borrow();
927
+
928
+ match &node.data.value {
929
+ ComrakNodeValue::CodeBlock(code_block) => Ok(code_block.fenced),
930
+ _ => Err(magnus::Error::new(
931
+ ruby.exception_type_error(),
932
+ "node is not a code block node",
933
+ )),
934
+ }
935
+ }
936
+
937
+ fn set_fenced(ruby: &Ruby, rb_self: &Self, new_fenced: bool) -> Result<bool, magnus::Error> {
938
+ let mut node = rb_self.inner.borrow_mut();
939
+
940
+ match node.data.value {
941
+ ComrakNodeValue::CodeBlock(ref mut code_block) => {
942
+ code_block.fenced = new_fenced;
943
+ Ok(true)
944
+ }
945
+ _ => Err(magnus::Error::new(
946
+ ruby.exception_type_error(),
947
+ "node is not a code block node",
948
+ )),
949
+ }
950
+ }
951
+
925
952
  fn get_fence_info(ruby: &Ruby, rb_self: &Self) -> Result<String, magnus::Error> {
926
953
  let node = rb_self.inner.borrow();
927
954
 
@@ -1227,6 +1254,8 @@ pub fn init(ruby: &Ruby, m_commonmarker: RModule) -> Result<(), magnus::Error> {
1227
1254
  c_node.define_method("list_start=", method!(CommonmarkerNode::set_list_start, 1))?;
1228
1255
  c_node.define_method("list_tight", method!(CommonmarkerNode::get_list_tight, 0))?;
1229
1256
  c_node.define_method("list_tight=", method!(CommonmarkerNode::set_list_tight, 1))?;
1257
+ c_node.define_method("fenced?", method!(CommonmarkerNode::get_fenced, 0))?;
1258
+ c_node.define_method("fenced=", method!(CommonmarkerNode::set_fenced, 1))?;
1230
1259
  c_node.define_method("fence_info", method!(CommonmarkerNode::get_fence_info, 0))?;
1231
1260
  c_node.define_method("fence_info=", method!(CommonmarkerNode::set_fence_info, 1))?;
1232
1261
 
@@ -53,6 +53,7 @@ const RENDER_IGNORE_EMPTY_LINKS: &str = "ignore_empty_links";
53
53
  const RENDER_GFM_QUIRKS: &str = "gfm_quirks";
54
54
  const RENDER_PREFER_FENCED: &str = "prefer_fenced";
55
55
  const RENDER_TASKLIST_CLASSES: &str = "tasklist_classes";
56
+ const RENDER_COMPACT_HTML: &str = "compact_html";
56
57
 
57
58
  pub fn iterate_render_options(comrak_options: &mut comrak::options::Render, options_hash: RHash) {
58
59
  options_hash
@@ -94,6 +95,9 @@ pub fn iterate_render_options(comrak_options: &mut comrak::options::Render, opti
94
95
  Cow::Borrowed(RENDER_TASKLIST_CLASSES) => {
95
96
  comrak_options.tasklist_classes = TryConvert::try_convert(value)?;
96
97
  }
98
+ Cow::Borrowed(RENDER_COMPACT_HTML) => {
99
+ comrak_options.compact_html = TryConvert::try_convert(value)?;
100
+ }
97
101
  _ => {}
98
102
  }
99
103
  Ok(ForEach::Continue)
@@ -126,6 +130,7 @@ const EXTENSION_SUBTEXT: &str = "subtext";
126
130
  const EXTENSION_ALERTS: &str = "alerts";
127
131
  const EXTENSION_CJK_FRIENDLY_EMPHASIS: &str = "cjk_friendly_emphasis";
128
132
  const EXTENSION_HIGHLIGHT: &str = "highlight";
133
+ const EXTENSION_INSERT: &str = "insert";
129
134
 
130
135
  pub fn iterate_extension_options(
131
136
  comrak_options: &mut comrak::options::Extension,
@@ -213,6 +218,9 @@ pub fn iterate_extension_options(
213
218
  Cow::Borrowed(EXTENSION_HIGHLIGHT) => {
214
219
  comrak_options.highlight = TryConvert::try_convert(value)?;
215
220
  }
221
+ Cow::Borrowed(EXTENSION_INSERT) => {
222
+ comrak_options.insert = TryConvert::try_convert(value)?;
223
+ }
216
224
  _ => {}
217
225
  }
218
226
  Ok(ForEach::Continue)
@@ -26,6 +26,7 @@ module Commonmarker
26
26
  gfm_quirks: false,
27
27
  prefer_fenced: false,
28
28
  tasklist_classes: false,
29
+ compact_html: false,
29
30
  }.freeze,
30
31
  extension: {
31
32
  strikethrough: true,
@@ -53,6 +54,7 @@ module Commonmarker
53
54
  alerts: false,
54
55
  cjk_friendly_emphasis: false,
55
56
  highlight: false,
57
+ insert: false,
56
58
  }.freeze,
57
59
  format: [:html].freeze,
58
60
  }.freeze
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmarker
4
- VERSION = "2.6.3"
4
+ VERSION = "2.7.0"
5
5
  end
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.6.3
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian