You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We might have found the following bug when playing around with it:
When adding a new default "Image Block" without further configuration (leaving the default image placeholder), the exported / generated HTML code embeds the default svg element as the image's src attribute value (cf attached screenshots).
Note: this would not satisfy a case where the embedAsBase64 option would be set to false, maybe in this case a public image placeholder URL could be used (TBD) ?
I'd be happy to open a PR to fix it, let me know :)
The text was updated successfully, but these errors were encountered:
mcottret
changed the title
[Bug]: Default image placeholder src generated / exported as <svg> element
[Bug]: Default image placeholder's src attribute generated / exported as <svg> element
Mar 3, 2020
mcottret
changed the title
[Bug]: Default image placeholder's src attribute generated / exported as <svg> element
[Bug]: Default image placeholder's src attribute generated / exported as <svg> element
Mar 3, 2020
grapesjs/src/dom_components/model/ComponentImage.js's getAttrToHTML function should call this.getSrcResult (not sure whether or not to use the fallback option) rather than this.get('src') to retrieve the base64 encoded image src attribute
Correct, ignore the fallback option, it's used in the canvas only when the image is failed to load.
Note: this would not satisfy a case where the embedAsBase64 option would be set to false, maybe in this case a public image placeholder URL could be used (TBD) ?
embedAsBase64 option is for the file upload, this has nothing to do with this issue
Hi, and thanks for the great library !
We might have found the following bug when playing around with it:
When adding a new default "Image Block" without further configuration (leaving the default image placeholder), the exported / generated HTML code embeds the default
svg
element as the image'ssrc
attribute value (cf attached screenshots).After digging a bit into the code, it appears that the
grapesjs/src/dom_components/model/ComponentImage.js
'sgetAttrToHTML
function should callthis.getSrcResult
(not sure whether or not to use thefallback
option) rather thanthis.get('src')
to retrieve the base64 encoded imagesrc
attribute (cf https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/ComponentImage.js#L78) .Note: this would not satisfy a case where the
embedAsBase64
option would be set tofalse
, maybe in this case a public image placeholder URL could be used (TBD) ?I'd be happy to open a PR to fix it, let me know :)
The text was updated successfully, but these errors were encountered: