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

normaliseBlocks: Don't break between inline siblings #3823

Merged
merged 2 commits into from Dec 11, 2017

Conversation

mcsf
Copy link
Contributor

@mcsf mcsf commented Dec 6, 2017

Description

When pasting rich content, blocks are split where new inline elements start, such as <a>:

Before After
screen shot 2017-12-06 at 01 57 47 screen shot 2017-12-06 at 01 58 11

How Has This Been Tested?

Copy the first paragraph from Wikipedia's entry on letterpress printing, paste to an empty post. Make sure that only one Paragraph is created, and that no formatting or content was lost from the source.

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

@mcsf mcsf added the [Feature] Raw Handling Related to the ability to convert content to blocks, paste handling, etc label Dec 6, 2017
@mcsf mcsf requested a review from ellatrix December 6, 2017 02:05
@jaswrks
Copy link
Contributor

jaswrks commented Dec 7, 2017

Looks good to me in latest Chrome on mac and in latest Firefox on mac.

2017-12-07_11-20-45

<p><strong>Letterpress printing</strong> is a technique of <a href="https://en.wikipedia.org/wiki/Relief_printing">relief printing</a> using a <a href="https://en.wikipedia.org/wiki/Printing_press">printing press</a>, a process by which many copies are produced by repeated direct impression of an inked, raised surface against sheets or a continuous roll of paper.<sup><a href="https://en.wikipedia.org/wiki/Letterpress_printing#cite_note-Encyclop.C3.A6dia_Britannica-1">[1]</a></sup> A worker composes and locks <a href="https://en.wikipedia.org/wiki/Movable_type">movable type</a> into the &quot;bed&quot; or &quot;chase&quot; of a press, <a href="https://en.wikipedia.org/wiki/Ink">inks</a> it, and presses paper against it to transfer the ink from the type which creates an impression on the paper.</p>

// Require that the first character be a letter. This notably
// prevents footnote markings ([1]) from being caught as
// shortcodes.
tag: '[a-z][a-z0-9_-]*',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole line looks a bit add to me... maybe I missed some conversation. There is now a fallback block block for unhandled shortcodes? What if they are inline shortcodes? I'll maybe open a new ticket, sorry. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, see #3610.

Inline shortcodes are definitely a problem. I’d be grateful if you could weigh in on #3806 (comment) !

@mcsf mcsf merged commit ad5db70 into master Dec 11, 2017
@mcsf mcsf deleted the fix/pasting-inline-siblings branch December 11, 2017 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Raw Handling Related to the ability to convert content to blocks, paste handling, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants