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 2 commits into from Dec 11, 2017


Copy link

mcsf commented Dec 6, 2017


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


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

This comment has been minimized.

Copy link

jaswrks commented Dec 7, 2017

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


<p><strong>Letterpress printing</strong> is a technique of <a href="">relief printing</a> using a <a href="">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="">[1]</a></sup> A worker composes and locks <a href="">movable type</a> into the &quot;bed&quot; or &quot;chase&quot; of a press, <a href="">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_-]*',

This comment has been minimized.

Copy link

ellatrix Dec 7, 2017


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. :)

This comment has been minimized.

Copy link

mcsf Dec 7, 2017

Author Contributor

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
3 checks passed
3 checks passed
codecov/project 37.75% (+<.01%) compared to 0e60bd7
continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed
@mcsf mcsf deleted the fix/pasting-inline-siblings branch Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.