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

strange code copy behavior #393

Open
nnaydenow opened this issue Feb 19, 2024 · 1 comment
Open

strange code copy behavior #393

nnaydenow opened this issue Feb 19, 2024 · 1 comment

Comments

@nnaydenow
Copy link

My editor has file which has following html code as source.

<!-- playground-hide -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sample</title>
</head>

<body>
    <!-- playground-hide-end -->
    <button>Some visible content>
    <!-- playground-hide -->
    <script type="module" src="main.js"></script>
</body>

</html>
<!-- playground-hide-end -->

If I do cmd + a, then cmd+v the whole page content is pasted even if only the <button>Some visible content> is the only displayed content inside the editor.

@jlukic
Copy link

jlukic commented Jun 10, 2024

I've noticed this as well folded or hidden content is included in the pasteable content when selecting all in the codemirror instance.

Perhaps there's a way to hook into CodeMirror's paste event to filter out the hidden content.

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

No branches or pull requests

2 participants