[wp-trac] [WordPress Trac] #46861: Block Editor: Classic block missing content in Preview

WordPress Trac noreply at wordpress.org
Fri Jun 28 14:57:46 UTC 2019


#46861: Block Editor: Classic block missing content in Preview
--------------------------+-----------------------------
 Reporter:  joyously      |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  5.3
Component:  Editor        |     Version:  5.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------------

Comment (by SergeyBiryukov):

 I was able to reproduce the issue with the following example:
 {{{
 <a href="#" title="<cite> represents a reference to a creative
 work.">...</a>
 }}}
 It results in this output on the front end:
 {{{
 <a href="#" title="<cite> represents a reference to a creative
 work.”>…</a>
 }}}
 Note the closing quote converted to `”`, breaking any markup that
 follows.

 With the `wptexturize()` filter disabled, the input works as expected.

 Using the Classic Editor (in both Visual and Text mode), the output is
 correct even with `wptexturize()` enabled:
 {{{
 <a title="<cite> represents a reference to a creative work."
 href="#">…</a>
 }}}

 So this appears to be a `wptexturize()` issue that only manifests with the
 Block Editor. I think the difference is that the Block Editor does not
 preserve the escaped `<cite>` tag in the `title` attribute,
 converting it to `<cite>`, and `wptexturize()` is confused by that.

 I guess the Block Editor should preserve `<` and `>` entities in
 HTML attributes. I've reopened the
 [https://github.com/WordPress/gutenberg/issues/14861 original GitHub
 issue] and commented there.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46861#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list