@ledvance/group-ui-biz-bundle 1.0.110 → 1.0.111
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.
package/package.json
CHANGED
|
@@ -57,23 +57,44 @@ const EnergyModal = (props: EnergyModalProps) => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
const getDescription = (string: string) => {
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
// 首先提取URL
|
|
61
|
+
const urlRegex = /(https?:\/\/[^\s]+)$/;
|
|
62
|
+
const urlMatch = string.match(urlRegex);
|
|
63
|
+
const url = urlMatch ? urlMatch[0] : '';
|
|
64
|
+
|
|
65
|
+
// 移除URL部分以处理正文文本
|
|
66
|
+
const textWithoutUrl = urlMatch
|
|
67
|
+
? string.slice(0, string.lastIndexOf(url)).trim()
|
|
68
|
+
: string;
|
|
69
|
+
|
|
70
|
+
// 分割文本但保留分隔符
|
|
71
|
+
const sentences:string[] = [];
|
|
72
|
+
const parts = textWithoutUrl.split(/([.:])/);
|
|
73
|
+
|
|
74
|
+
for (let i = 0; i < parts.length - 1; i += 2) {
|
|
75
|
+
if (i + 1 < parts.length) {
|
|
76
|
+
sentences.push(parts[i] + parts[i + 1]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<View>
|
|
82
|
+
{sentences.map((sentence, index) => (
|
|
83
|
+
<View key={index}>
|
|
84
|
+
<Text style={{ color: props.theme?.global.fontColor }}>{sentence.trim()}</Text>
|
|
85
|
+
<Spacer />
|
|
86
|
+
</View>
|
|
87
|
+
))}
|
|
88
|
+
{url && (
|
|
89
|
+
<Text
|
|
90
|
+
style={{ textDecorationLine: 'underline', color: props.theme?.button.primary }}
|
|
91
|
+
onPress={() => openLink(url)}
|
|
92
|
+
>
|
|
93
|
+
{url}
|
|
94
|
+
</Text>
|
|
95
|
+
)}
|
|
96
|
+
</View>
|
|
97
|
+
);
|
|
77
98
|
}
|
|
78
99
|
|
|
79
100
|
useUpdateEffect(() =>{
|