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 +4 -4
- data/lib/chat_sdk/x/format_converter.rb +0 -25
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0268010c9db7fac8c879b00c0612242482c6d8a482b3a301b6817205c514a52
|
|
4
|
+
data.tar.gz: f5099d980b6c5c20731811fd48f560a88e8f9d79df40f08d37ecd699907fd4d9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|