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

Quote block: Using cite elements in quoted content causes block to become invalid. #11652

Closed
ZebulanStanphill opened this issue Nov 9, 2018 · 1 comment
Labels
[Block] Quote Affects the Quote Block [Feature] Block Transforms Block transforms from one block to another [Type] Question Questions about the design or development of the editor.

Comments

@ZebulanStanphill
Copy link
Member

The issue

If you insert a <cite> element into the quoted content of a Quote block, the block becomes invalid.

Reproduction steps

  1. Insert a Quote block.
  2. Add some content to the quoted content area (not the citation).
  3. In the block toolbar, open the More Options (ellipsis) menu and choose Edit as HTML.
  4. Add something like <cite>Book Title</cite> to the quoted content (in the <p> element).
  5. Try switching back to edit the block visually.
  6. Notice that the block becomes invalid.

Alternatively, just paste this into your post while using the Code Editor:

<!-- wp:quote -->
<blockquote class="wp-block-quote"><p>blah<cite>book title</cite>blah</p></blockquote>
<!-- /wp:quote -->

Suggested fix

Currently, the citation of the Quote block is simply a <cite> following the last <p>. I think that instead, the citation should be a <cite> nested in a <footer> after the last <p>. This would allow <cite> tags to be used outside of the citation of the Quote block, for use cases such as marking a book or game title. This would also be more semantically correct. Please check out the following:

@mcsf
Copy link
Contributor

mcsf commented Nov 9, 2018

Thanks for the feedback. I think this is worth cross-linking with #11440 as another data point, but it's not something we should look at individually. Technically speaking, we're dealing with a block that was explicitly manipulated with new markup, which is something blocks aren't meant to know how to deal with, and that's exactly what the Convert to HTML is there for.

Finally, we have previously discussed what the standard markup for Quote should be; there was a lot of back-and-forth there until we came to the current shape, and at this stage of 5.0 we are not reopening that discussion.

@mcsf mcsf closed this as completed Nov 9, 2018
@mcsf mcsf added [Type] Question Questions about the design or development of the editor. [Feature] Block Transforms Block transforms from one block to another [Block] Quote Affects the Quote Block labels Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Quote Affects the Quote Block [Feature] Block Transforms Block transforms from one block to another [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

2 participants