-
Notifications
You must be signed in to change notification settings - Fork 41
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
fix pasting of markdown containing links #93
fix pasting of markdown containing links #93
Conversation
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.
Thanks for taking the time to make this PR @susanwere!
I've left some comments, because I think we need to go in a slightly different direction here. Let's try to ensure that:
- Any behaviour we add is well tested.
- We don't rely on the user agent to determine which behaviour we use.
Given the above two, I would be happy to re-review this if it:
- Retains the tests that are in place (even if they're altered).
- Adds new tests (to cover the new edge cases we've discovered).
- Removes the user agent sniffing and uses feature detection instead.
If you need any assistance with this please let me know, and I'd be happy to pair.
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.
This LGTM 👍 nice work!
👋 This is a second attempt to fix https://github.com/github/issues/issues/5429
After merging this PR in master we realised that the fix didn't solve the issue. I did a second check and found the following issue which causes the bug.
While creating the tree walker, we specified that we only want to show nodes that are elements. This works well in the chrome browser because it generates
span
for texts that don't have a html tag as shown in the screenshots below. For Firefox, texts that don't have a html tag are skipped because they are not identified as elements thereby causing the bug.The fix is to SHOW_ALL nodes for firefox and only SHOW_ELEMENTs for chrome.
Before
before.mov
After
after.mov