"Streched" option in image tool affects one up level block while loading saved data !
See original GitHub issueconst editor = new EditorJS({
autofocus: true,
tools: {
// Tools
},
data: {
"time": 1566562504744,
"blocks": [{
"type": "header",
"data": {
"text": "Editor.js Test",
"level": 2
}
},
{
"type": "paragraph",
"data": {
"text": "Classic WYSIWYG-editors produce raw HTML-markup with both content data and content appearance. On the contrary, Editor.js outputs JSON object with data of each Block. You can see an example below"
}
},
{
"type": "image",
"data": {
"file": {
"url": "https://images.unsplash.com/photo-1566501483151-508bc205c847?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1266&q=80"
},
"caption": "",
"withBorder": false,
"stretched": true,
"withBackground": false
}
}
],
"version": "2.15.0"
}
});
When i load the saved data above in EditorJS; despite the image streched option is true, ce-block--stretched
class is applied to one level up block, which is the paragraph in the example.
As a result, paragraph is streched but image stays default.
Is it a bug or am i missing something?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
Improving the display of raster data—Help | ArcGIS for Desktop
If your raster data represents continuous data, you can apply a contrast stretch to it based on the statistics of the raster dataset....
Read more >Image Processing with Python - Data Carpentry
The images we see on hard copy, view with our electronic devices, or process with our programs are represented and stored in the...
Read more >Use the Image web part - Microsoft Support
This article describes how to use the Image web part. Use it to insert an image on the page, either from your site,...
Read more >Insert and edit images in Dreamweaver - Adobe Support
Learn how to insert, edit, replace, and resize images and image placeholders in your web pages in Dreamweaver.
Read more >CSS Image size, how to fill, but not stretch? - Stack Overflow
Save this question. Show activity on this post. But If I set width and height using css ( width:150px; height:100px ), image will...
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 FreeTop 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
Top GitHub Comments
Mmk I got it. I was able to fix it in the image plugin.
In
src/index.js
I’ll submit a PR on that repo because the fix is actually there.
This is where the where the block gets stretched in the image plugin, but I think this is actually related to another issue with
editorjs.api.blocks.getCurrentBlockIndex()
returningindex - 1
instead ofindex
https://github.com/editor-js/image/blob/70876fde289e9f8baa81ee4b5c8c3dc036ac7035/src/index.js#L354-L367