Skip to content

Support keyboard shortcut for formatted Vs Unformatted paste - #60

Closed
zutshisunakshi wants to merge 6 commits into
github:mainfrom
zutshisunakshi:upstream/theinterned/unformatted-class
Closed

zutshisunakshi wants to merge 6 commits into
github:mainfrom
zutshisunakshi:upstream/theinterned/unformatted-class

Conversation

@zutshisunakshi

Copy link
Copy Markdown
Contributor

Ref: https://github.com/github/special-projects/issues/966

Context:
Add support for keyboard shortcuts where when : cmd/ctrl+ shift + v pastes unformatted content like for paste links http://... and cmd/ctrl + v formatted auto linked link on selected text like [...](http://...)

Screen.Recording.2022-05-11.at.11.27.58.PM.mov

Approach 2

This PR adds support for paste on using keyboard shortcuts - this approaches the fix by creating a class with required keydown handler/helper methods to toggle state which would decide when to paste formatted ( markdown ) content Vs not for a consistent paste.

🍐 @theinterned

@zutshisunakshi
zutshisunakshi requested a review from a team as a code owner May 12, 2022 03:47
@zutshisunakshi

Copy link
Copy Markdown
Contributor Author

Open to feedback/thoughts on this approach Vs in #59

@@ -0,0 +1,26 @@
type UMap = WeakMap<HTMLElement, boolean>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this name UMap could be more clear

@@ -0,0 +1,26 @@
type UMap = WeakMap<HTMLElement, boolean>
export class PasteKeyBoardShortcut {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this class (and the file name, and the instances) be something like PasteFormatSkipper?

@zutshisunakshi

Copy link
Copy Markdown
Contributor Author

Closing in support of #59 being better voted approach.

@zutshisunakshi
zutshisunakshi deleted the upstream/theinterned/unformatted-class branch May 13, 2022 09:26
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