Closed 0nko closed 6 years ago
I've tested this PR with a small GB post, and was wondering if we should show the Unknown block item ?
, instead of hiding GB blocks altogether.
If you edit a GB post it looks empty in the visual mode, or, if you edit a post that is a mix of GB blocks and "conventional" text, it looks half empty and the result is a weird experience.
Sorry if this has already been discussed somewhere and I've forgot about it, or missed the convo.
Good question. @diegoreymendez, do have this in Aztec iOS?
In WPiOS we're replacing the Gutenberg comment blocks with zero-width spaces in visual mode... sort of hiding them (although backspacing would sort of let you know you're deleting one). At the time we implemented this it was agreed to be a simple compromise solution. Especially since Aztec is an HTML-standard editor so any efforts to make it "handle" Gutenberg code would be misplaced and counterproductive IMO.
Anything more complicated has the potential of becoming a big effort we'd rather avoid in Aztec (since Gutenberg mobile is where we want to be putting that effort).
@maxme is the closest we have to a product owner though, so maybe he has other thoughts on this.
Just to be clear... we're "hiding" the opening and closing comment blocks, but the content is parsed as regular HTML.
I've changed the implementation so that only the GB comments are hidden, the content is rendered normally. I've added figure
, figcaption
and section
to a list of hidden elements because GB blocks place HTML inside them.
@mzorz I'd like to get another review on this PR. Would you mind to take a quick look?
Would you mind to take a quick look?
sure thing!
This PR implements the special Gutenberg code block HTML from the visual editor, as suggested in #541.
The regular comment-hiding was unsuitable for this task so now there is a new type of plugin interface -
IHtmlContentHandler
. A plugin that implements it is supplied with the content of a declared element and the element is skipped by the parser.