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

removeMarkupFromRange fails when range includes empty section #128

Closed
bantic opened this issue Sep 15, 2015 · 0 comments · Fixed by #138
Closed

removeMarkupFromRange fails when range includes empty section #128

bantic opened this issue Sep 15, 2015 · 0 comments · Fixed by #138
Assignees

Comments

@bantic
Copy link
Collaborator

bantic commented Sep 15, 2015

removeMarkupFromRange expects to always have a head and tail marker, but that's not true when the final section is blank.

To reproduce:

  • create an empty section below a section with text in it
  • position cursor in the empty section and use shift + to select the line above
  • hit cmd-B to bolden text
  • result: Uncaught TypeError: Cannot read property 'renderNode' of undefined
@bantic bantic assigned bantic and unassigned bantic Sep 15, 2015
bantic added a commit that referenced this issue Sep 15, 2015
bantic added a commit that referenced this issue Sep 16, 2015
When a range ended in a blank section there was no tailMarker for that
range, causing some issues specifically around postEditor#splitMarkers

  * Add #splitMarkerAtOffset method to markerables, refactor
    postEditor#splitMarkers to use it
  * Add #_markDirty and #_scheduleForRemoval to postEditor
  * refactor to only call `scheduleDidUpdate` and `scheduleRerender` in
    postEditor after marking something dirty or for removal

fixes #128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant