guardian / scribe

DEPRECATED: A rich text editor framework for the web platform
http://guardian.github.io/scribe/
Apache License 2.0
3.51k stars 245 forks source link

Normalize text nodes when removing the markers. #421

Closed wearhere closed 9 years ago

wearhere commented 9 years ago

Placing the markers may have split a text node. If we don't sew it up when removing the markers and the user presses space between the nodes, the browser will insert an   and that will cause word wrapping issues.

Simple way to reproduce the issue:

  1. Open http://guardian.github.io/scribe/.
  2. Delete the space between "Hello," and "World!".
  3. Press space.

Note that there is now an   between "Hello," and "World!".

Where this could be a problem:

  1. Open http://guardian.github.io/scribe/.
  2. Add to the line until it wraps to the second line (resizing your browser window helps) like so: screen shot 2015-07-28 at 5 05 00 pm
  3. Press delete at the start of the second line (e.g. before "this" in the screenshot).
  4. Press space.

Expected result: the word before the deletion e.g. "like" goes back to the first line. Actual result: the word before the deletion stays on the second line.

rrees commented 9 years ago

@wearhere apologies for the delay in merging this, I'm going to look at testing and releasing it now

rrees commented 9 years ago

Released as v2.0.0

wearhere commented 9 years ago

Thanks!