Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use inline embeds/attachments #15

Open
hopsoft opened this issue Aug 24, 2023 · 0 comments
Open

Update to use inline embeds/attachments #15

hopsoft opened this issue Aug 24, 2023 · 0 comments
Labels
blocked enhancement New feature or request

Comments

@hopsoft
Copy link
Owner

hopsoft commented Aug 24, 2023

Bring back the renderTrixAttachment method for inline embeds if/when this PR gets merged and released.

  renderTrixAttachment(content) {
     const attachment = new Trix.Attachment({ content, contentType: trixEmbedMediaTypes.attachment })
     const piece = new Trix.AttachmentPiece(attachment)
     const view = new Trix.AttachmentView(attachment, { piece })

     const figure = Trix.makeElement({
       tagName: 'figure',
       className: view.getClassName(),
       data: view.getData(),
       editable: false
     })

     figure.innerHTML = attachment.getContent()
     return figure.outerHTML
   }
@hopsoft hopsoft added enhancement New feature or request blocked labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant