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

Unable to save most embed types #55

Open
mendhak opened this issue May 1, 2024 · 1 comment
Open

Unable to save most embed types #55

mendhak opened this issue May 1, 2024 · 1 comment

Comments

@mendhak
Copy link

mendhak commented May 1, 2024

Hi hope I can explain this well.

When trying to use the Embed Tool, most embed types get blocked in editorjs-html by default with this error message:

Saving failed: Error: Only Youtube and Vime Embeds are supported right now.

I tried looking at the PR that introduced this but I couldn't figure out why it was being blocked.

Is there a way to allow other embeds through "as-is" as raw HTML? So this way we can create our custom embeds and just have it saved. There are probably thousands of different sites that provide embeds so it would be impractical to have a specific code for each one, that's why I'm wondering about a fallback 'raw HTML' approach?

Thanks

@mendhak
Copy link
Author

mendhak commented May 1, 2024

OK I think a workaround could be, define a custom parser (which editorjs-html) allows, and have it just

function embedParser(block){
                        return `<iframe src="${block.data.embed}" scrolling="no" frameborder="0" style="border: none;" width="600" height="557" data-external="1"></iframe>`
                        
                    }

And then give it to the parser when you initialise it

const edjsParser = edjsHTML({ embed: embedParser, });

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

No branches or pull requests

1 participant