Skip to content

Add support for editorjs list 2.0 and improve image translation #64

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

blade47
Copy link

@blade47 blade47 commented Jun 13, 2025

I assume most people, like me, use this library for email purposes.
Besides upgrading list I have also improved the image layout to adapt it to email clients:

Screenshot 2025-06-15 at 07 14 07

@blade47 blade47 changed the title Add support for editorjs list 2.0 Add support for editorjs list 2.0 and improve image translation Jun 15, 2025

return `<img src="${url}" alt="${caption}" />`;
return `<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @blade47
Can you update this to just return an image? this might be the best option for emails but the purpose of the lib is to simply return html and with existing projects using this would break the functionality.

Also, you could add any styling using css. Ideally, the image element should just return image. On the other end, I am okay with you adding a custom parser which can then be plugged in the library constructor.

@@ -1,19 +1,70 @@
import { OutputBlockData } from "@editorjs/editorjs";

export const list = ({ data }: OutputBlockData) => {
const listStyle = data.style === "unordered" ? "ul" : "ol";
let listStyle = "ul";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use const instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants