Skip to content

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

Open
blade47 wants to merge 3 commits into
pavittarx:masterfrom
blade47:master
Open

Add support for editorjs list 2.0 and improve image translation#64
blade47 wants to merge 3 commits into
pavittarx:masterfrom
blade47:master

Conversation

@blade47

@blade47 blade47 commented Jun 13, 2025

Copy link
Copy Markdown

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
Comment thread src/parsers/image.ts
const isCaptionBlank = !caption || caption.trim() === "";

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

Copy link
Copy Markdown
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.

Comment thread src/parsers/list.ts

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

Copy link
Copy Markdown
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?

The header parser ignored data.alignment, so EditorJS headers set to
center/right/justify rendered left-aligned wherever this package renders to
HTML (e.g. engagement emails via the send-notifications lambda). Mirror the
paragraph parser: read data.alignment || data.align and emit an inline
text-align style. Headers without alignment are unchanged.

Rebuilt .build bundles (tracked; no build-on-publish). Released as
@blade47/editorjs-html@4.0.9.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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