ajout d'image

This commit is contained in:
2026-05-26 18:48:25 +02:00
parent a1c4365f39
commit 600f2b6196
8 changed files with 226 additions and 1 deletions
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { marked } from 'marked';
import { IssueEntity, IssuesStore } from '../issues.store';
import { IssueComments } from '../issue-comments/issue-comments';
import { handleImagePaste, insertAtSelection } from '../paste-image.util';
@Component({
selector: 'app-issue-detail',
@@ -205,6 +206,15 @@ export class IssueDetail {
return this.issueTypeValue === 'Epic';
}
protected onDescriptionPaste(event: ClipboardEvent): void {
const ta = event.target as HTMLTextAreaElement;
const start = ta.selectionStart;
const end = ta.selectionEnd;
handleImagePaste(event, (md) => {
this.issue.description = insertAtSelection(ta, this.issue.description, start, end, md);
});
}
protected get descriptionHtml(): SafeHtml {
const html = marked.parse(this.issue.description || '') as string;
return this.sanitizer.bypassSecurityTrustHtml(html);