@devchitchat/chat 4.4.1 → 4.4.3
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
|
@@ -502,7 +502,6 @@ export default function CallIsland(root) {
|
|
|
502
502
|
const threadRepliesEl = document.getElementById('thread-replies')
|
|
503
503
|
const threadInputEl = document.getElementById('thread-input')
|
|
504
504
|
const threadSendBtn = document.getElementById('thread-send')
|
|
505
|
-
const threadCloseBtn = document.getElementById('thread-panel-close')
|
|
506
505
|
|
|
507
506
|
let activeThreadParentId = null
|
|
508
507
|
|
|
@@ -553,8 +552,10 @@ export default function CallIsland(root) {
|
|
|
553
552
|
if (threadRepliesEl) threadRepliesEl.innerHTML = ''
|
|
554
553
|
}
|
|
555
554
|
|
|
556
|
-
//
|
|
557
|
-
|
|
555
|
+
// Use delegation so both the top ✕ and the mobile footer "Close thread" button work
|
|
556
|
+
threadPanelEl?.addEventListener('click', e => {
|
|
557
|
+
if (e.target.closest('.thread-panel-close')) closeThread()
|
|
558
|
+
})
|
|
558
559
|
|
|
559
560
|
function sendThreadReply() {
|
|
560
561
|
const text = threadInputEl?.value.trim()
|
|
@@ -38,9 +38,9 @@ export function makeDateSeparator(dateKey) {
|
|
|
38
38
|
*/
|
|
39
39
|
// Combined regex (operates on raw text before HTML-escaping):
|
|
40
40
|
// group 1 (+ inner 2, 3) — markdown link: [text](url)
|
|
41
|
-
// group 4 — bare https?:// URL (excludes []() so it can't swallow
|
|
41
|
+
// group 4 — bare https?:// URL (excludes []()* so it can't swallow markdown bold/link syntax)
|
|
42
42
|
// group 5 — @mention
|
|
43
|
-
const INLINE_RE = /(\[([^\]]*)\]\((https?:\/\/[^)]+)\))|(https?:\/\/[^\s<>"'[\]()]+)|(@[a-zA-Z0-9_.-]+)/g
|
|
43
|
+
const INLINE_RE = /(\[([^\]]*)\]\((https?:\/\/[^)]+)\))|(https?:\/\/[^\s<>"'[\]()*]+)|(@[a-zA-Z0-9_.-]+)/g
|
|
44
44
|
|
|
45
45
|
export function renderText(text, { userHandle } = {}) {
|
|
46
46
|
let result = ''
|
|
@@ -54,7 +54,7 @@ export function renderText(text, { userHandle } = {}) {
|
|
|
54
54
|
// [link text](https://url)
|
|
55
55
|
result += `<a href="${escHtml(mdUrl)}" target="_blank" rel="noopener noreferrer">${escHtml(mdText)}</a>`
|
|
56
56
|
} else if (bareUrl) {
|
|
57
|
-
const trimmed = bareUrl.replace(/[.,!?;:)]+$/, '')
|
|
57
|
+
const trimmed = bareUrl.replace(/[.,!?;:)*]+$/, '')
|
|
58
58
|
const trailing = bareUrl.slice(trimmed.length)
|
|
59
59
|
result += `<a href="${escHtml(trimmed)}" target="_blank" rel="noopener noreferrer">${escHtml(trimmed)}</a>${escHtml(trailing)}`
|
|
60
60
|
} else if (mention) {
|