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

fix pasting into fenced code block #2641

Merged
merged 8 commits into from
Dec 13, 2018
Merged

Conversation

daiyam
Copy link
Contributor

@daiyam daiyam commented Nov 25, 2018

Description

This change fixes the pasting in code block.
It avoid the pasted code to be parsed as HTML and so avoid any \ or new lines to be added to the code.

Issue fixed

Type of changes

  • 🔘 Bug fix (Change that fixed an issue)
  • ⚪ Breaking change (Change that can cause existing functionality to change)
  • ⚪ Improvement (Change that improves the code. Maybe performance or development improvement)
  • ⚪ Feature (Change that adds new functionality)
  • ⚪ Documentation change (Change that modifies documentation. Maybe typo fixes)

Checklist:

  • 🔘 My code follows the project code style
  • ⚪ I have written test for my code and it has been tested
  • 🔘 All existing tests have been passed
  • ⚪ I have attached a screenshot/video to visualize my change if possible

@sasikanth513
Copy link

I just found out about bootsnote and i'm trying to save few gists into the app. I've tried to paste it from browser to app, I see lot of \ in the pasted snippet.

screenshot 2018-11-25 at 8 49 11 pm

@ZeroX-DG ZeroX-DG added the awaiting review ❇️ Pull request is awaiting a review. label Nov 27, 2018
- add shortcut to paste smartly
- use electron's clipboard
@daiyam
Copy link
Contributor Author

daiyam commented Nov 27, 2018

I've added the option to enable/disable to paste as HTML
screenshot

and the shortcut to do it even if it's disabled
screenshot

But the major change is that instead of using the browser's clipboard, it uses the electron's clipboard (so the code can be shared between the new shortcut and Ctrl+V).
So, when pasting smartly, it can also recognize images in Data URI.

@ZeroX-DG
Copy link
Member

@daiyam can you resolve the conflict?

Copy link
Member

@ZeroX-DG ZeroX-DG left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@ZeroX-DG ZeroX-DG added approved 👍 Pull request has been approved by sufficient reviewers. and removed awaiting review ❇️ Pull request is awaiting a review. labels Dec 13, 2018
@Rokt33r Rokt33r added next release (v0.11.12) and removed approved 👍 Pull request has been approved by sufficient reviewers. labels Dec 13, 2018
@Rokt33r Rokt33r merged commit 743c979 into BoostIO:master Dec 13, 2018
@richardtks
Copy link
Contributor

@daiyam what is feature of smart paste? Just curious.

@daiyam
Copy link
Contributor Author

daiyam commented Dec 15, 2018

@richardtks if the copied data is some html code (from navigator or styled terminal), it convert the it as markdown code (h1 becomes an heading). But it won't convert if it's pasted in a code block.

@daiyam daiyam deleted the fix-paste-code branch December 17, 2018 21: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.

5 participants