Import raw HTML on init
See original GitHub issueHi,
is it possible to import custom HTML into EditorJS on initialization?
For example - I have already existing HTML page, for which I need some WYSIWYG functionality.
Currently when I do:
<div id="page-content">
<p>Hello</p>
<p>World</p>
</div>
var editor = new EditorJS({
holder : 'page-content'
});
then existing content of element “page-content” is ignored, and editor is just appended at the end (e.g. page bottom).
Creates new empty space rather than importing two existing <p>
nodes - Hello
and World
.
So it seems that EditosJS can only load supplied data
of JSON blocks on initialization and cannot load any custom HTML contents. Is that correct or did I miss something … ?
I also looked over plugins - could not find any plugin for importing/parsing/loading supplied HTML.
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:18
Top Results From Across the Web
TinyMCE insert raw html into active editor - Stack Overflow
Using WindowManager for TinyMCE I open a window and it writes back raw HTML. But its truncating my links for my images.
Read more >Render Raw HTML In Your Vue Apps - DigitalOcean
Perhaps, for some reason you need to render raw HTML in your Vue components. Never fear: v-html is here.
Read more >html-loader - webpack
Export into HTML files ... A very common scenario is exporting the HTML into their own .html file, to serve them directly instead...
Read more >Raw HTML object
From the "Objects" toolbar item, select "Raw HTML." · Enter your HTML into the editor that appears. · To see the HTML in...
Read more >How to get content from the editor and set content | TinyMCE
How to set content on initialization; How to get the content without any HTML tags; Why isn't the getContent working? This article also...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you. i found a way. i get error with await ( i`m not using react - may be thats why)
but i added it to onReady and everything works like a charm
onReady: () => { editor.blocks.renderFromHTML(“<?=trim(preg_replace('/\s\s+/', ' ', addslashes($rw['body'])))?>”) }
but have an issue with images - i get an error ( Image Tool: uploading failed because of incorrect response: {“url”:“http://myimageurl”} )
cant figure out what is correct responce - trying send just http://myimageurl - same thing. google not helped yet.
@lubosdz I found the way!