Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Zero-width space added to newlines #1408

Closed
8 tasks
mikesol opened this issue Dec 1, 2021 · 3 comments · Fixed by #1409
Closed
8 tasks

Zero-width space added to newlines #1408

mikesol opened this issue Dec 1, 2021 · 3 comments · Fixed by #1409
Labels
bug Something isn't working highlight-code Highlight code web component

Comments

@mikesol
Copy link

mikesol commented Dec 1, 2021

Affected part of DeckDeckGo

  • Studio (online editor)
  • Remote control
  • Poll
  • Site
  • Documentation
  • Demo
  • Starter kit
  • [ x] Web Components
  • Templates

This report is about highlight-code.

Reproduction

Steps to reproduce:

  1. Go to https://mikesol.github.io/sf/crash-course and copy any of the code snippets.
  2. Paste the snippet into the blank slate player on wags.fm.

Expected Behavior

The example should be copied verbatim as it was input/written/typed (meaning what was in the code bloc provided to deckdeckgo).

Actual Behavior

At least on macOS, all newlines have a zero-width space append to them.

Environment

  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

THANK YOU for looking into this! I found a workaround to strip the zero-width spaces, but a proper fix would be helpful if possible.

@peterpeterparker peterpeterparker added enhancement New feature or request highlight-code Highlight code web component bug Something isn't working and removed enhancement New feature or request labels Dec 1, 2021
@peterpeterparker
Copy link
Contributor

Thanks for reporting the issue @mikesol !

The component needs zero width spaces to display empty lines, therefore, to solve your issue, I added an event listener on copy that checks if the action is performed within the component and cleans the spaces from the clipboard.

It has been released in the component v3.6.0 and I also bumped the requirements in the gatsby plugin v3.1.0.

Let me know if it works out.

@peterpeterparker
Copy link
Contributor

Btw. https://wags.fm/ is quite fun, well played 👍

@mikesol
Copy link
Author

mikesol commented Dec 2, 2021

Thanks for being so quick to get to this! I'll let you know once I update the gatsby site.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working highlight-code Highlight code web component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants