fix(ui): escape brackets in filename and use paragraph break for inline images
Escape `[` and `]` in filenames to prevent malformed markdown when attaching images. Use `\n\n` instead of `\n` so the image renders as its own paragraph instead of inline with preceding text. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -340,8 +340,9 @@ export function CommentThread({
|
||||
try {
|
||||
if (imageUploadHandler) {
|
||||
const url = await imageUploadHandler(file);
|
||||
const markdown = ``;
|
||||
setBody((prev) => prev ? `${prev}\n${markdown}` : markdown);
|
||||
const safeName = file.name.replace(/[[\]]/g, "\\$&");
|
||||
const markdown = ``;
|
||||
setBody((prev) => prev ? `${prev}\n\n${markdown}` : markdown);
|
||||
} else if (onAttachImage) {
|
||||
await onAttachImage(file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user