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

capture enter key, create new sections #28

Merged
merged 5 commits into from
Jul 31, 2015
Merged

capture enter key, create new sections #28

merged 5 commits into from
Jul 31, 2015

Conversation

bantic
Copy link
Collaborator

@bantic bantic commented Jul 28, 2015

ready to merge

Adds Cursor model for semantically handling selection.
Adds reparseSection to the Post parser that can reparse markers.
Handles newline semantically -- capture the ENTER keydown event and split the section at the cursor and insert a new section.

To do:

  • add tests for different actions in the editor (hit enter inside marker, hit enter at beginning/end of section, when in a section that is not the last section, etc)
  • move cursor to new section after hitting enter
  • handle deleting an entire marker (make text bold, delete to beginning of text and once more)
  • handle deleting from beginning of a section into previous section
  • bug: on FF, entering text in new section removes it

In future PR:

  • remove extraneous Cursor methods
  • handle hitting enter when text is selected
  • Capture delete to control joining sections and preventing browser from generating HTML inside empty P tags
  • Safari/FF bug: deleting an empty section moves cursor to weird place:

bug2

@bantic bantic force-pushed the markers-cory branch 2 times, most recently from 322915a to 01d5069 Compare July 29, 2015 20:07
bantic and others added 5 commits July 31, 2015 11:52
…nd unprintable chars in editor HTML

 * move cursor to new section after hitting enter
 * Select the first marker el in a new section rather than the section el
 * Append blank marker to empty section, only create markup from valid tag
 * Do not modify/wrap element in section element in Section parser
mixonic added a commit that referenced this pull request Jul 31, 2015
capture enter key, create new sections
@mixonic mixonic merged commit 5028e64 into master Jul 31, 2015
@mixonic mixonic deleted the markers-cory branch July 31, 2015 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants