rich editor

This commit is contained in:
2026-05-14 23:10:07 +03:00
parent f99aadee83
commit d1c896acf4
5 changed files with 36 additions and 47 deletions
+10 -9
View File
@@ -11,15 +11,16 @@
value = e.target.value;
}
export function insertMedia(info) {
if (info.file.width > 0) {
var attachment = new Trix.Attachment({ content: info.html });
editor.editor.insertAttachment(attachment);
} else {
editor.editor.insertHTML(
`<a href="${info.originalUrl}">${info.file.filename}</a>`,
);
}
export function insertMedia(html) {
console.log({ html });
var attachment = new Trix.Attachment({ content: html });
editor.editor.insertAttachment(attachment);
// if (info.file.width > 0) {
// var attachment = new Trix.Attachment({ content: html });
// editor.editor.insertAttachment(attachment);
// } else {
// editor.editor.insertHTML(html);
// }
}
onMount(() => {