chat_sdk-slack 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: 891f26261fed4ebb89b98b19ec57f2b304d9d3f8bedea493faa1457ac1bb742e
4
- data.tar.gz: 9c1cc01f502f92642b89944aafc0ad24188d92c3c734d67735f00299c3bc6571
3
+ metadata.gz: 229d477d831f90275df64bc7eb47447ba4fcb574f435806d2839c3aa3154d106
4
+ data.tar.gz: a538ab5f51da90868d3fd4b018ba33d98b97d703d952844909cdc614e5a08e10
5
5
  SHA512:
6
- metadata.gz: 4f59922bead78ae2f1f8a81cfc7f990d4ab2ef3c1fd193463def34897cb286696ac61c34699156435e21ed61c436099cfe1e3935ae84600b49c739f8beae8264
7
- data.tar.gz: 07257e9662397d48d5c19798a2d8e5292b541ee600f046683a44b4b43b285dd1ab96900aa2eb0c5c593da885a98e26d8269c1c17a31b8c81d7cf7d549cefb3ca
6
+ metadata.gz: 86a3e66cc7be0f102beb2ce1d12c4b7e6ba60df6e0dbaa6887a43a3ff15dbbc16c1d003573cb12093a763fb338eb7d37205be62717c3feffbd6560533f73ea62
7
+ data.tar.gz: 0b78d5335690d409deedc6a69f45a57093ab559a35a0e20f1ee4518b883afc924f5919a4b2f46e1b50dc12fd443ae7eb9547c3c268daff1928c6db37244f1902
@@ -21,16 +21,6 @@ module ChatSDK
21
21
 
22
22
  private
23
23
 
24
- # Splits text into alternating [text, code, text, code, ...] segments.
25
- # Odd-indexed segments are code blocks (including their delimiters) and
26
- # should be passed through without conversion.
27
- def split_code_blocks(text)
28
- # Match fenced code blocks (```...```) and inline code (`...`)
29
- # The fenced block pattern must come first so triple backticks aren't
30
- # eaten by the inline pattern.
31
- text.split(/(```[\s\S]*?```|`[^`]+`)/)
32
- end
33
-
34
24
  # ── Slack mrkdwn → Markdown ──────────────────────────────────────────
35
25
 
36
26
  def convert_mrkdwn_to_md(text)
@@ -81,14 +71,8 @@ module ChatSDK
81
71
  # Links: [text](url) -> <url|text>
82
72
  result = result.gsub(/\[([^\]]+)\]\(([^)]+)\)/) { "<#{Regexp.last_match(2)}|#{Regexp.last_match(1)}>" }
83
73
 
84
- # Bold: **text** -> *text* (use placeholder to prevent italic pass from catching it)
85
- result = result.gsub(/\*\*(.+?)\*\*/, "\x00BOLD\\1BOLD\x00")
86
-
87
- # Italic: *text* -> _text_ (only single asterisks remaining after bold placeholder)
88
- result = result.gsub(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/, '_\1_')
89
-
90
- # Restore bold placeholders
91
- result = result.gsub(/\x00BOLD(.+?)BOLD\x00/, '*\1*')
74
+ # Bold/italic with placeholder to prevent double conversion
75
+ result = convert_bold_and_italic_from_md(result, bold_char: "*", italic_char: "_")
92
76
 
93
77
  # Strikethrough: ~~text~~ -> ~text~
94
78
  result = result.gsub(/~~(.+?)~~/, '~\1~')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chat_sdk-slack
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