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(paste): do not convert url to macro while raw pasting #8815

Merged
merged 4 commits into from Mar 15, 2023

Conversation

situ2001
Copy link
Collaborator

@situ2001 situ2001 commented Mar 13, 2023

fix #8810, #8809

We should not change the data or text in clipboard but keep it unchanged while raw-pasting? is true.

@cnrpman
Copy link
Collaborator

cnrpman commented Mar 13, 2023

Is #8809 also related to the condition?

@situ2001
Copy link
Collaborator Author

Is #8809 also related to the condition?

Yes

(defn- wrap-macro-url
[url]
(cond
(boolean (text-util/get-matched-video url))
(util/format "{{video %s}}" url)
(string/includes? url "twitter.com")
(util/format "{{twitter %s}}" url)
:else
(do
(notification/show! (util/format "No macro is available for %s" url) :warning)
nil)))

@logseq-cldwalker
Copy link
Collaborator

@situ2001 Thanks for fixing raw paste for links. Looks like this was introduced in #5396. Going to add a test and address #8810 (comment)

Remove warning for no macro wrapping as that is excessive warning
Copy link
Collaborator

@logseq-cldwalker logseq-cldwalker left a comment

Choose a reason for hiding this comment

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

@situ2001 Thanks for pushing on copy+paste fixes. 👍 ❤️ It's important for us to be less buggy here. I've added some tests to prevent regressions on these. It's still possible to macro wrap on raw paste mode here. I don't have any thingatpt/markdown-src-at-point examples to test on but hopefully we'll clean all this up with more testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reversed behavior when pasting a twitter link with Ctrl+V or Ctrl+Shift+V
3 participants