Add support for editorjs list 2.0 and improve image translation#64
Open
blade47 wants to merge 3 commits into
Open
Add support for editorjs list 2.0 and improve image translation#64blade47 wants to merge 3 commits into
blade47 wants to merge 3 commits into
Conversation
pavittarx
requested changes
Jun 16, 2025
| const isCaptionBlank = !caption || caption.trim() === ""; | ||
|
|
||
| return `<img src="${url}" alt="${caption}" />`; | ||
| return `<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%"> |
Owner
There was a problem hiding this comment.
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.
|
|
||
| export const list = ({ data }: OutputBlockData) => { | ||
| const listStyle = data.style === "unordered" ? "ul" : "ol"; | ||
| let listStyle = "ul"; |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: