ajout d'image
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user