Skip to content

Copy pasting from code blocks on the ducmentation tool frustrating and losing formatting #21034

Closed

Description

@ferrybig

Documentation is

  • Missing
  • Outdated
  • Confusing
  • Not sure?

Explain in Detail

I tried to copy some text from the vite documentation to use in my own project. This experience is frustrating. Once you manage to select the text, vite also mangles your clipboard entry

Browser: Firefox 144.0 (64-bits) on Arch Linux

Your Suggestion for Changes

If a user starts selecting some text, do not show popups.

If a user has selected some text, do not clear the selecting when a popup shows

If a user starts selecting text, do not extend the text selection to the end of the document

If a user presses CTRL+C, copy the selected text directly to the clipboard, instead of adding random enters to the text

(This has worked flawlessly in the past)

Reproduction

https://vite.dev/guide/backend-integration.html

Steps to reproduce

vite.mp4

Activity

  1. added
    documentation
    on Oct 31, 2025
  2. sapphi-red commented on Nov 1, 2025

    @sapphi-red
    Member

    Made an issue upstream: shikijs/shiki#1088

    By the way, if you just need to copy the whole code, you can use the copy button instead.

    Image
  3. added
    bug: upstream
    on Nov 1, 2025
  4. ferrybig commented on Nov 1, 2025

    @ferrybig
    Author

    It looks like the upstream bug report only applies to 1 of the 4 "Your Suggestion for Changes" issues, namely:

    • If a user starts selecting some text, do not show popups.

    it doesn't seem to address the following points:

    • If a user has selected some text, do not clear the selecting when a popup shows
    • If a user starts selecting text, do not extend the text selection to the end of the document
    • If a user presses CTRL+C, copy the selected text directly to the clipboard, instead of adding random enters to the text

    I did a test in another browser, all 4 of these issues are broken in Firefox, but not in Chromium

  5. bluwy commented on Nov 1, 2025

    @bluwy
    Member

    FWIW no1 will also fix no3, because the popup is a fixed element at the end of the html and if selected it'll match to the end of the html. And no2 is fixed with my noAutoFocus suggestion there.

  6. bluwy commented on Nov 3, 2025

    @bluwy
    Member
    • If a user presses CTRL+C, copy the selected text directly to the clipboard, instead of adding random enters to the text

    shikijs/shiki#948

  7. locked and limited conversation to collaborators on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: upstreamdocumentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions