Open fabiankaegy opened 4 years ago
Yes, the reason behind using BlockPreview
is actually dynamic blocks. Most of them have an edit
version that mimics the frontend and relies on a REST API but without running the PHP
logic which can't be used here.
It is also the same reason why the BlockPreview
component in Gutenberg relies on edit
and not save
. I think we should just follow whatever Gutenberg decides to use here.
Maybe we could show the "save" as a tab or something.
I like the idea of the save tab :)
Would you say the implementation I have is okay or do you have a better way to do this than dangerouslySetInnerHTML ?
I think it's good 👍 .
@youknowriad I have updated this PR with an implementation of a Save
tab. I am not confident in the wether the styles from current Theme get selected or what needs to be done to get them to be applied. Would love your feedback 👍
While working with the BlockBook I came across an issue where I had no way of checking the actually markup produced by the blocks ( within the
save
method ).I'm sure there was a reason behind you using the
BlockPreview
component, but I would love to know what that is, and wether you see a place for something like what I did in this pr?