правки

This commit is contained in:
Artem Tsyrulnikov
2026-02-18 20:47:19 +03:00
parent e48cd7bccc
commit 4b9e5bf4df
12 changed files with 92 additions and 70 deletions

View File

@@ -65,7 +65,6 @@ const buttonURLPlaceholder = "https://example.com"
var inviteLinkPattern = regexp.MustCompile(`https?://t\.me/(?:\+|joinchat/)[a-zA-Z0-9_-]+`)
var inviteLinkTagPattern = regexp.MustCompile(`<a\s+class="tg-link">\s*(.*?)\s*</a>`)
var htmlTagPattern = regexp.MustCompile(`<[^>]+>`)
const (
inputModeText = "text"
@@ -193,7 +192,7 @@ func (e *CreativeEditorFields) GetCreativeText() string {
sub := inviteLinkTagPattern.FindStringSubmatch(match)
inner := ""
if len(sub) > 1 {
inner = strings.TrimSpace(htmlTagPattern.ReplaceAllString(sub[1], ""))
inner = strings.TrimSpace(sub[1])
}
if inner == "" {
inner = inviteLinkPreviewURL