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

Fix parsing images in parseImage #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abdallahalsamman
Copy link

$block looks like

object(stdClass)#4365 (5) {
["file"]=>
object(stdClass)#5500 (1) {
["url"]=>
string(x) "...."
}
["caption"]=>
NULL
["withBorder"]=>
bool(false)
["stretched"]=>
bool(false)
["withBackground"]=>
bool(false)
}

img src should be block->data->file->url and not block->data->url

I'm using this library https://github.com/editor-js/image

$block looks like 

object(stdClass)#4365 (5) {                                                                           
  ["file"]=>                                                                                          
  object(stdClass)#5500 (1) {                                                                         
    ["url"]=>                                                                                         
    string(x) "...."             
  }                                                                                                   
  ["caption"]=>                                                                                       
  NULL                                                                                                
  ["withBorder"]=>                                                                                    
  bool(false)                                                                                         
  ["stretched"]=>                                                                                     
  bool(false)                                                                                         
  ["withBackground"]=>                                                                                
  bool(false)                                                                                         
}

img src should be block->data->file->url and not block->data->url
Copy link
Owner

@Edd-G Edd-G left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!

This will break parsing simple-image block. This block type name same as image
https://github.com/editor-js/simple-image

Maybe add a check $block->data->url exist?

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

Successfully merging this pull request may close these issues.

2 participants