commonmarker 1.1.1 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e44c667eb26709fe581dde448ecc77c918cfe8535c87fac4b9034384a454173f
4
- data.tar.gz: 6134cc6f7bdf35151db8226c0e9c7620f1291d4a73258511c59318dc6206aacd
3
+ metadata.gz: dcfe5afe736de6389674b8f9dde0ce59c2ef47edad89941fbe484a041bc86897
4
+ data.tar.gz: 581c06aee0a9045226dfe92e5fedd1625b9d5c9f8ffdff373930c660426398b8
5
5
  SHA512:
6
- metadata.gz: aa9a3712ac627045d59dbd96dd7626e1d65259691a934a74872fcec3818d00baa1647b1c34e7e4c27e1675dc5cf63aa2b1ee4cf0f43aeacf2a5ae543e3ea7c6e
7
- data.tar.gz: 326767ad16f232e312b3000e1627740c16ce5f0030d8476331c4f325c1233206fb6972b6a104f9ca9b83136f643a8a81df42707033c4c901018077d81640ec2c
6
+ metadata.gz: 966b17cd354ce4e7798b66eca2c73a6363db0a9a3091160614b29cd1b48e1647b4c2b2dd0583dc5ddddf18acd045a99f19ac7505c93132d68a5975aeaa81e716
7
+ data.tar.gz: 7b78bfd01e7b53840fe9cd700ca7421320ede39a2cc53ab0edf2cb3def80fe09c8a8bf23b322a8e775b3b45eae8f45496b5f46beedbb3d3e2dca1140f7e0c20a
data/Cargo.lock CHANGED
@@ -517,9 +517,9 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
517
517
 
518
518
  [[package]]
519
519
  name = "magnus"
520
- version = "0.6.3"
520
+ version = "0.6.4"
521
521
  source = "registry+https://github.com/rust-lang/crates.io-index"
522
- checksum = "0fc7a31fb0b64761e3cd09a6975577601fccc5f08b8fc9245064fc4f71ed6a9d"
522
+ checksum = "b1597ef40aa8c36be098249e82c9a20cf7199278ac1c1a1a995eeead6a184479"
523
523
  dependencies = [
524
524
  "magnus-macros",
525
525
  "rb-sys",
@@ -669,6 +669,14 @@ impl CommonmarkerNode {
669
669
  fn get_string_content(&self) -> Result<String, magnus::Error> {
670
670
  let node = self.inner.borrow();
671
671
 
672
+ match node.data.value {
673
+ ComrakNodeValue::Code(ref code) => return Ok(code.literal.to_string()),
674
+ ComrakNodeValue::CodeBlock(ref code_block) => {
675
+ return Ok(code_block.literal.to_string())
676
+ }
677
+ _ => {}
678
+ }
679
+
672
680
  match node.data.value.text() {
673
681
  Some(s) => Ok(s.to_string()),
674
682
  None => Err(magnus::Error::new(
@@ -681,6 +689,18 @@ impl CommonmarkerNode {
681
689
  fn set_string_content(&self, new_content: String) -> Result<bool, magnus::Error> {
682
690
  let mut node = self.inner.borrow_mut();
683
691
 
692
+ match node.data.value {
693
+ ComrakNodeValue::Code(ref mut code) => {
694
+ code.literal = new_content;
695
+ return Ok(true);
696
+ }
697
+ ComrakNodeValue::CodeBlock(ref mut code_block) => {
698
+ code_block.literal = new_content;
699
+ return Ok(true);
700
+ }
701
+ _ => {}
702
+ }
703
+
684
704
  match node.data.value.text_mut() {
685
705
  Some(s) => {
686
706
  *s = new_content;
@@ -1088,8 +1108,5 @@ pub fn init(m_commonmarker: RModule) -> Result<(), magnus::Error> {
1088
1108
  c_node.define_method("fence_info", method!(CommonmarkerNode::get_fence_info, 0))?;
1089
1109
  c_node.define_method("fence_info=", method!(CommonmarkerNode::set_fence_info, 1))?;
1090
1110
 
1091
- c_node.define_method("fence_info", method!(CommonmarkerNode::get_fence_info, 0))?;
1092
- c_node.define_method("fence_info=", method!(CommonmarkerNode::set_fence_info, 1))?;
1093
-
1094
1111
  Ok(())
1095
1112
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmarker
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.3"
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: 1.1.1
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-05-01 00:00:00.000000000 Z
12
+ date: 2024-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb_sys