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

Extra whitespace and line breaks being inserted on paste in Windows. #7364

Open
kjrocker opened this issue Jan 6, 2025 · 2 comments
Open
Assignees
Labels
area: extensions/widgets/markdown pinned type: bug code to address defects in shipped code

Comments

@kjrocker
Copy link

kjrocker commented Jan 6, 2025

Describe the bug

Extra whitespace and line breaks being inserted on paste in Windows. It's a new line in front, and 2 new lines afterwards. It doesn't matter if I'm copying from the middle of the line, or the middle of a word, any paste creates the extra space.

To Reproduce

  1. Use Windows
  2. Use a markdown widget.
  3. Attempt to copy-paste text into the widget.
  4. Note the extra line breaks.

Expected behavior

It should paste the text as expected, only adding new lines if they were copied.

Screenshots

Video attached.

Applicable Versions:

  • Decap CMS version: decap-cms@^3.1.2
  • Git provider: Github
  • OS: Windows 10
  • Browser version: Current versions of Chrome, Firefox, Edge, Brave.

CMS configuration

backend:
  name: git-gateway
  repo: <repo>
  branch: main
  squash_merges: true
local_backend: true
publish_mode: editorial_workflow
show_preview_links: true

media_folder: "src/assets/uploads"
public_folder: "src/assets/uploads"
collections:
  - name: "games"
    label: "Game Reviews"
    folder: "src/content/game"
    create: true
    media_folder: "media"
    public_folder: "media"
    preview_path: game/{{slug}}
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Description", name: "description", widget: "string" }
      - { label: "Title Image", name: "image", widget: "image" }
      - {
          label: "Featured?",
          name: "featured",
          widget: "boolean",
          default: false,
        }
      - { label: "Body", name: "body", widget: "markdown" }
      - { label: "Date", name: "date", widget: "datetime", default: "{{now}}" }
      - {
          label: "Author",
          name: "author",
          widget: "hidden",
          default: "Janneke",
        }
  - name: recipes
    label: "Recipes"
    folder: "src/content/recipe"
    create: true
    media_folder: "media"
    public_folder: "media"
    preview_path: around-the-world-in-vegan-ways/{{slug}}
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Country", name: "description", widget: "string" }
      - { label: "Featured Image", name: "image", widget: "image" }
      - {
          label: "Category",
          name: "category",
          widget: "select",
          required: true,
          options: [
            { value: "breakfast", label: "Breakfast" },
            { value: "sandwich", label: "Sandwich" },
            { value: "sides", label: "Sides" },
            { value: "entrees", label: "Entrees" },
            { value: "desserts", label: "Desserts" },
          ],
        }
      - {
          label: "Recipe",
          name: "recipe",
          widget: "markdown",
          default: "## Ingredients\n\n- First\n\n## Instructions\n\n1. First",
        }
      - { label: "Body", name: "body", widget: "markdown" }
      - {
          label: "Author",
          name: "author",
          widget: "hidden",
          default: "Janneke",
        }
      - { label: "Date", name: "date", widget: "datetime", default: "{{now}}" }

  - name: "blog"
    label: "Blog"
    folder: "src/content/blog"
    create: true
    media_folder: "media"
    public_folder: "media"
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Description", name: "description", widget: "string" }
      - {
          label: "Author",
          name: "author",
          widget: "string",
          default: "Janneke",
        }
      - { label: "Date", name: "date", widget: "datetime" }
      - { label: "Featured Image", name: "image", widget: "image" }
      - { label: "Image Alt Text", name: "imageAlt", widget: "string" }
      - { label: "Body", name: "body", widget: "markdown" }

Additional context

Screen.Recording.2025-01-06.125842.mp4
@martinjagodic
Copy link
Member

may be caused by #7290

@kjrocker
Copy link
Author

kjrocker commented Jan 6, 2025

This interesting thing is that it's happening to plain text, but ONLY on windows. This doesn't duplicate in Fedora at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: extensions/widgets/markdown pinned type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants