chat_sdk-whatsapp 0.8.0 → 0.8.1

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: e420bdbdf90d49945a4bedf2459b2ad52d3aa3702ed73f3ef531cb327a15fb5c
4
- data.tar.gz: 7bba518a3f18eca2254c52f97c2dcb1af54ca2bdd823cef3a92dd4c3fae3d7e7
3
+ metadata.gz: 0d7c52b157faa0646077dd3044014702c05649965374072a2e961cf61d356dd0
4
+ data.tar.gz: 3bda0cd18ee75406ad07085e28d7ee61e92af98061a2761c0e8c8847c87a1fa3
5
5
  SHA512:
6
- metadata.gz: 81e7ff4856c14a188378a97269635076b0e2bf00038eeace77147b15a7ee996b7c03aa8efd8a74f0f82a52f4f06c858aa639be5339152f353da717239c7c60fb
7
- data.tar.gz: e6fbb0668012855875d2dac4c00b612fdf4d61aa36906398fedfaae7031f7e928834f00c89c637863e1bdd243a573fb4eb3e91f5ddc9b1790f0134559469515d
6
+ metadata.gz: 789e7d79d27f136c9c5cde8df138a75cb128e1783c49b3528fea765e16c39a346eabff9c32d8bc988f3cfda7483a4ac06f307f705d5d6a2f7000a02fc2cd9274
7
+ data.tar.gz: d5977f541e427eb4a68939489004f35eecb407201d4a057f6bc00afb4cbf0b1a5114c313ca21611da4eafd35550aad3ca6f1249b2bf994380887d2d793c6a997
@@ -23,10 +23,6 @@ module ChatSDK
23
23
 
24
24
  private
25
25
 
26
- def split_code_blocks(text)
27
- text.split(/(```[\s\S]*?```|`[^`]+`)/)
28
- end
29
-
30
26
  def convert_whatsapp_to_md(text)
31
27
  result = text
32
28
 
@@ -43,14 +39,8 @@ module ChatSDK
43
39
  def convert_md_to_whatsapp(text)
44
40
  result = text
45
41
 
46
- # Bold: **text** → *text* (placeholder to prevent italic pass from catching it)
47
- result = result.gsub(/\*\*(.+?)\*\*/m, "\x00BOLD\\1BOLD\x00")
48
-
49
- # Italic: *text* → _text_ (only single asterisks remaining after bold placeholder)
50
- result = result.gsub(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/m, '_\1_')
51
-
52
- # Restore bold placeholders
53
- result = result.gsub(/\x00BOLD(.+?)BOLD\x00/m, '*\1*')
42
+ # Bold/italic with placeholder to prevent double conversion
43
+ result = convert_bold_and_italic_from_md(result, bold_char: "*", italic_char: "_")
54
44
 
55
45
  # Strikethrough: ~~text~~ → ~text~
56
46
  result.gsub(/~~(.+?)~~/m, '~\1~')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chat_sdk-whatsapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quentin Rousseau