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 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.
@jaswrks

This comment has been minimized.

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_-]*',

This comment has been minimized.

Copy link
@ellatrix

ellatrix Dec 7, 2017

Member

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

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
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@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
Projects
None yet
3 participants
You can’t perform that action at this time.