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

don't make plus-signs selectable #3578

Closed
SimonSiefke opened this issue Feb 23, 2020 · 7 comments · Fixed by #3912
Closed

don't make plus-signs selectable #3578

SimonSiefke opened this issue Feb 23, 2020 · 7 comments · Fixed by #3912
Labels

Comments

@SimonSiefke
Copy link
Contributor

Expected behavior:

I can copy and paste the code, the plus-signs are not copied with the code.

Current behavior:

When I copy and paste the code, I manually need to remove each + because the the plus-signs are copied along with the code.

webpack-select

@anikethsaha
Copy link
Member

Those + and - signs are required in order to make it better to understand how to change the code for migration or how to replace any deprecated APIs with the new one.

these are not usually long snippets so manually deleting should not be a much of work. 👍

@SimonSiefke
Copy link
Contributor Author

I was thinking that maybe

<p><span style="user-select:none">+</span>document.body.removeChild(element);</p>
<p><span style="user-select:none">+</span>element = component();</p>
<p><span style="user-select:none">+</span>document.body.appendChild(element);</p>

would be a good solution.

I agree that it is not much work to manually remove the plus-signs but I think it is unnecessary and that the guides would be improved when the code can just be copied and pasted.

@chenxsan
Copy link
Member

chenxsan commented Mar 30, 2020

@SimonSiefke It could be possible to target the + - prefix if we bring Prismjs plugin https://prismjs.com/plugins/diff-highlight/ support into Refactor which this doc site relies one.

@DanielRuf
Copy link
Contributor

Or render :before pseudo elements.

I think this issue can be closed as PrismJS/prism#2281 is merged?

@chenxsan
Copy link
Member

@DanielRuf That commit is not released in a new version PrismJS yet. Maybe we can keep this issue open if we do want to bring this feature into doc site.

@chenxsan
Copy link
Member

chenxsan commented Aug 7, 2020

@chenxsan
Copy link
Member

I've created a pull request here #3912 so anyone can check how it looks like now https://webpack-js-org-git-fork-chenxsan-feature-user-select-none-diff.webpack-docs.vercel.app/guides/asset-management/#loading-images.

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

Successfully merging a pull request may close this issue.

5 participants