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:
parent
d114927814
commit
2ba0f5914f
1 changed files with 3 additions and 2 deletions
|
|
@ -340,8 +340,9 @@ export function CommentThread({
|
||||||
try {
|
try {
|
||||||
if (imageUploadHandler) {
|
if (imageUploadHandler) {
|
||||||
const url = await imageUploadHandler(file);
|
const url = await imageUploadHandler(file);
|
||||||
const markdown = ``;
|
const safeName = file.name.replace(/[[\]]/g, "\\$&");
|
||||||
setBody((prev) => prev ? `${prev}\n${markdown}` : markdown);
|
const markdown = ``;
|
||||||
|
setBody((prev) => prev ? `${prev}\n\n${markdown}` : markdown);
|
||||||
} else if (onAttachImage) {
|
} else if (onAttachImage) {
|
||||||
await onAttachImage(file);
|
await onAttachImage(file);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue