chat_sdk-x 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: 0cc78776461860e0f234747c168059eba9e1af62401e97752f9b0e9c9c60fe62
4
- data.tar.gz: c158cf5c06608dc12c5b238ec0653c6e25a62dc77e50dba0cc07ca6ba4a4bda2
3
+ metadata.gz: c0268010c9db7fac8c879b00c0612242482c6d8a482b3a301b6817205c514a52
4
+ data.tar.gz: f5099d980b6c5c20731811fd48f560a88e8f9d79df40f08d37ecd699907fd4d9
5
5
  SHA512:
6
- metadata.gz: 559ab2ada28ef4a7dfeea3224dc4c2fd2645352d902f1d52758a2f2eb3d07b3fe723de14f6f4e7c229758f5024a1bdfc8f83e0661c402b88679a41ebee4c037e
7
- data.tar.gz: bfc0a4e918126c31492a0e3ad54ffdea98792b3452934b222a052439f6a9ac71856127366ce1bd92708b412466c3e332144c13c0dd5380aef7c9663c39da1861
6
+ metadata.gz: decc80efcb1b116b2cda75678f3f2ab53d42aafffe5f71d4a1bb0e1a6bce9befd91ed42017b7adea69ec5b1f6d0f8d1ef14aeb97acacea8aa54ad229b2ae7970
7
+ data.tar.gz: f9665c2b2642fab38b369888e88cfd3b5384b6d21d1da0f83e32157a4e1942eca97e6e39233ff64c6f827ec9f28ae253ed604eaf3708fb1fba23e0d19c86e5ea
@@ -8,37 +8,12 @@ module ChatSDK
8
8
  platform_text.to_s
9
9
  end
10
10
 
11
- # Markdown → X (strip all formatting to plain text)
12
11
  def from_markdown(markdown)
13
12
  text = markdown.to_s
14
13
  return "" if text.empty?
15
14
 
16
15
  strip_markdown(text)
17
16
  end
18
-
19
- private
20
-
21
- def strip_markdown(text)
22
- result = text
23
-
24
- # Remove fenced code blocks but keep content
25
- result = result.gsub(/```\w*\n?([\s\S]*?)```/, '\1')
26
-
27
- # Remove inline code markers
28
- result = result.gsub(/`([^`]+)`/, '\1')
29
-
30
- # Convert links: [text](url) → text (url)
31
- result = result.gsub(/\[([^\]]+)\]\(([^)]+)\)/, '\1 (\2)')
32
-
33
- # Remove bold markers: **text** → text
34
- result = result.gsub(/\*\*(.+?)\*\*/m, '\1')
35
-
36
- # Remove italic markers: *text* → text
37
- result = result.gsub(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/m, '\1')
38
-
39
- # Remove strikethrough markers: ~~text~~ → text
40
- result.gsub(/~~(.+?)~~/m, '\1')
41
- end
42
17
  end
43
18
  end
44
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chat_sdk-x
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