commonmarker 1.1.1 → 1.1.2

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: 0ea9527eceec73a2bab7247ca87911f0f41d0d24ed4615e21ee314e2f3d6bc2d
4
+ data.tar.gz: 6f66c38930a2d218b6295a5f689619691975b93a03074978e0751a74592c3613
5
5
  SHA512:
6
- metadata.gz: aa9a3712ac627045d59dbd96dd7626e1d65259691a934a74872fcec3818d00baa1647b1c34e7e4c27e1675dc5cf63aa2b1ee4cf0f43aeacf2a5ae543e3ea7c6e
7
- data.tar.gz: 326767ad16f232e312b3000e1627740c16ce5f0030d8476331c4f325c1233206fb6972b6a104f9ca9b83136f643a8a81df42707033c4c901018077d81640ec2c
6
+ metadata.gz: 4cc98dc04146e884b0b91e62d53b56cdc1fb2a1739705a18a523015a44d88b85550264c7d008bff5ba0262cd2ac9e09d014e8bec190a195c5d88ce4ab61eddd1
7
+ data.tar.gz: 29ddab6152567bff92f769b70bb5be476a4bda05202c03fd8b0a3b3eef2754e32524f854d19db73e530349b742de242419bc27192dcac0eee1a1eb8412b83460
@@ -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;
@@ -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.2"
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.2
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-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb_sys