fix: encode & decode file paths (#843)

This commit is contained in:
Aiden Cline
2025-07-10 11:19:54 -05:00
committed by GitHub
parent e9c954d45e
commit 8b2a909e1f
2 changed files with 6 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/base64"
"fmt"
"log/slog"
"net/url"
"os"
"path/filepath"
"strconv"
@@ -180,7 +181,7 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
attachment := &textarea.Attachment{
ID: uuid.NewString(),
Display: "@" + filePath,
URL: fmt.Sprintf("file://./%s", filePath),
URL: fmt.Sprintf("file://./%s", url.PathEscape(filePath)),
Filename: filePath,
MediaType: mediaType,
}