-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Auto link: fix bug when entering link at end of paragraph #678
Conversation
@@ -125,7 +125,7 @@ module.exports = function (grunt) { | |||
consolidate: true | |||
}, | |||
keepRunner: true, | |||
template: require('grunt-template-jasmine-istanbul'), | |||
//template: require('grunt-template-jasmine-istanbul'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry. Didn't think I committed that - had disabled the template to make debugging the unit test page easier, re-enabled now.
Could you remove dist files from your PR ? Thanks |
If the user adds some spaces after what used to be an autolink, it shouldn't cause the auto-link span to be removed. Move the spaces outside of the span instead.
39598c5
to
741cb77
Compare
…elements After code review it was suggested to import/export the selection with reference to all possible parent block elements (h1, h2, pre, blockquote) rather than just the paragraph tag. This may make the functionality more useful for other applications.
} else { | ||
// Some editing has happened to the span, so just remove it entirely. The user can put it back | ||
// around just the href content if they need to prevent it from linking | ||
while (spans[i].childNodes.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use Util.unwrap()
for this I believe
This forward-from-the-start counting strategy was suggested by nmielnik as possibly being easier to read than the way it was working in the previous commits (counting backward). Also adds more tests to cover cases that were discovered while working on this strategy.
Auto link: suggestions from code review "possible-suggestions"
Auto link: fix bug when entering link at end of paragraph
Auto link: fix bug when entering link at end of paragraph
Fix the following issue with auto-link: