rich editor
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user