decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.8k stars 3.03k forks source link

Invisible character showing up on markdown body #6725

Closed nalmeida closed 1 year ago

nalmeida commented 1 year ago

Describe the bug Invisible character showing up on markdown body when adding a blogpost using the CMS.

image

Due to this character the md file is not processed.

PS.: checked the file encoding and it is UTF-8

Expected behavior Expect to have the exact MD body, without it.

Applicable Versions:

CMS configuration

backend:
  name: github
  repo: nalmeida/netlify-cms-cloudflare-pages
  branch: main # Branch to update (optional; defaults to master)
  base_url: https://netlify-cms-cloudflare-pages.pages.dev
  auth_endpoint: /api/auth

site_url: https://netlify-cms-cloudflare-pages.pages.dev

media_folder: src/upload/img
public_folder: upload/img

collections:
  - name: 'blog'
    label: 'Blog'
    folder: 'src/content/blog'
    create: true
    slug: '{{slug}}'
    editor:
      preview: true
    fields:
      - { label: 'Title', name: 'title', widget: 'string' }
      - { label: 'Publish Date', name: 'date', widget: 'datetime' }
      - { label: 'Description', name: 'description', widget: 'string' }
      - { label: 'Body', name: 'body', widget: 'markdown' }
      - { label: "Layout", name: "layout", widget: "hidden", default: "layouts/post.njk"}

  - name: 'settings'
    label: 'Settings'
    delete: false # Prevent users from deleting documents in this collection
    editor:
      preview: false
    files:
      - name: 'general'
        label: 'Site Settings'
        file: 'src/_data/settings.json'
        description: 'General Site Settings'
        fields:
          - { label: 'Global title', name: 'site_title', widget: 'string' }
          - label: 'Post Settings'
            name: posts
            widget: 'object'
            fields:
              - {
                  label: 'Number of posts on frontpage',
                  name: front_limit,
                  widget: number,
                  min: 1,
                  max: 10,
                }
              - { label: 'Default Author', name: author, widget: string }
              - {
                  label: 'Default Thumbnail',
                  name: thumb,
                  widget: image,
                  class: 'thumb',
                  required: false,
                }
danurbanowicz commented 1 year ago

6602

nalmeida commented 1 year ago

I have followed the suggested changing CSS property WebkitUserModify: read-write-plaintext-only of the editor to WebkitUserModify: read-write.

I saved https://unpkg.com/netlify-cms@2.10.192/dist/netlify-cms.js locally to my project and made the change you said and it seems so far so great!

The issue may be closed.

danurbanowicz commented 1 year ago

Glad the workaround solved your problem.

A future dependency update (Slate) will likely fix this.

You can help the maintainers by closing this issue.