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

Hr support #21

Closed
wants to merge 20 commits into from
Closed

Hr support #21

wants to merge 20 commits into from

Conversation

y-lohse
Copy link
Contributor

@y-lohse y-lohse commented Sep 5, 2013

This patch allows inserting hr (#19) by pressing enter when the previous paragraph is empty. In that case the previous paragraph is replaced by the hr. I loosely tested it in the latests chrome, firefox & IE and it works fine. The native deletion of a hr however varies from browser to browser, as mentioned in #20.

Aside from that the patch refactors some not-so-minor things:

  • the hr stuff was vastly different from text parsing, so I created a new triggerNodeAnalysis function. I think it will become usefull when we address Backspace bugs #20 as well
  • triggerTextParse had some repetition with triggerNodeAnalysis so I moved the common code inside an anonymous function called upon keyup. This function does the common checkings and then calls the 2 others.
  • I renamed and slightly changed the behavior of hasParentWithTag. It now returns the first parent element that matches the given type instead of just true. It still works as a test function as previously but is also used in 3 places to grab a parent node.

@mduvall
Copy link
Owner

mduvall commented Sep 5, 2013

This looks good! There's some git funkiness going on here, do you mind rebasing and squashing the relevant commits? The hr branch should be up to date with master now.

@y-lohse y-lohse closed this Sep 6, 2013
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