diff --git a/pkg/channels/http.go b/pkg/channels/http.go
index 31313ff9d..e46201f23 100644
--- a/pkg/channels/http.go
+++ b/pkg/channels/http.go
@@ -282,6 +282,12 @@ func generateChatID(r *http.Request) string {
// renderMarkdown converts Markdown to HTML using goldmark
func renderMarkdown(input string) string {
+ // Debug: log first 100 chars of input
+ // logger.DebugF("http renderMarkdown input", map[string]any{"input": input[:min(100, len(input))]})
+
+ // Convert newlines to
before markdown processing
+ input = strings.ReplaceAll(input, "\n", " \n")
+
md := goldmark.New(
goldmark.WithExtensions(
extension.GFM,
@@ -292,7 +298,15 @@ func renderMarkdown(input string) string {
var buf strings.Builder
if err := md.Convert([]byte(input), &buf); err != nil {
+ logger.ErrorCF("http", "renderMarkdown error", map[string]any{"error": err.Error()})
return input // fallback to plain text on error
}
return buf.String()
+}
+
+func min(a, b int) int {
+ if a < b {
+ return a
+ }
+ return b
}
\ No newline at end of file
diff --git a/pkg/channels/http_templates/index.html b/pkg/channels/http_templates/index.html
index 62c425a67..bfff7ef70 100644
--- a/pkg/channels/http_templates/index.html
+++ b/pkg/channels/http_templates/index.html
@@ -116,7 +116,7 @@
display: flex;
gap: 12px;
}
- .input-wrapper input {
+ .input-wrapper textarea {
flex: 1;
padding: 14px 20px;
border: 2px solid #2d2d44;
@@ -125,12 +125,18 @@
color: white;
font-size: 1rem;
outline: none;
- transition: border-color 0.2s;
+ resize: none;
+ min-height: 56px;
+ max-height: 200px;
+ line-height: 1.5;
+ box-sizing: border-box;
+ font-family: inherit;
+ overflow-y: auto;
}
- .input-wrapper input:focus {
+ .input-wrapper textarea:focus {
border-color: #ff6b35;
}
- .input-wrapper input::placeholder {
+ .input-wrapper textarea::placeholder {
color: #64748b;
}
.input-wrapper button {
@@ -196,7 +202,7 @@