Skip to content

Newline is not behaving correctly with Headers #7501

@obreo

Description

@obreo

Describe the bug
When creating a new line with shift + enter it uses \ by default. But I noticed creating a new line does not render correctly when using Headers (like \H1), in this case the \ is being considered as H1. Also the Backslash \ shows up when clicking on any header.

Is there anyway to use
instead if \ when clicking shift + enter. I use MDX and i think this is a better solution than \

To Reproduce

Expected behavior
The highlighted text should be used as Header and nothing else. and the backslash should not show up in the Rich Text when highlighting text as header.

Screenshots

Applicable Versions:

  • Decap CMS version: [3.0.0]
  • Git provider: [GitHub]
  • OS: Windows 11]
  • Browser version [137.0.7151.70]
  • Node.JS version: 20

CMS configuration

media_folder: "public/uploads"
public_folder: "/uploads"
publish_mode: editorial_workflow

collections:

  • name: "blog"
    label: "Blog"
    folder: "src/content/blog"
    editor:
    preview: true
    preview: BlogPreview
    extension: "mdx"
    format: "frontmatter"
    create: true
    slug: "{{slug}}"
    fields:

    • { label: "Title", name: "title", widget: "string" }
      #- { label: "Subtitle", name: "subtitle", widget: "string", required: false }
    • { label: "Description", name: "description", widget: "text", required: false }
    • { label: "Publish Date", name: "pubDate", widget: "datetime" }
    • { label: "Author", name: "author", widget: "string", required: false }
    • { label: "Author Bio", name: "authorBio", widget: "text", required: false }
    • { label: "Author Avatar", name: "authorAvatar", widget: "image", required: false }
    • { label: "Cover", name: "cover", widget: "image", required: false }
    • { label: "Alt Text", name: "alt", widget: "string", required: false }
    • { label: "Tags", name: "tags", widget: "list", required: false }
    • { label: "Body", name: "body", widget: "markdown" }
    • { name: layout, label: Layout, default: ../../layouts/ArticlesLayout.astro, widget: hidden }
  • name: "services"
    label: "Services"
    folder: "src/content/services"
    preview: ServicePreview
    create: true
    editor:
    preview: true
    slug: "{{slug}}"
    format: "frontmatter"
    extension: "mdx"
    fields:

    • { label: "Title", name: "title", widget: "string" }
      #- { label: "Subtitle", name: "subtitle", widget: "string", required: false }
    • { label: "Description", name: "description", widget: "string", required: false }
    • { label: "Icon", name: "icon", widget: "image", required: false }
    • { label: "Cover Image", name: "cover", widget: "image", required: false }
    • { label: "Call to Action Text", name: "cta", widget: "hidden", required: false}
    • { label: "CTA Link", name: "ctaLink", widget: "hidden", required: false}
    • { label: "Body", name: "body", widget: "markdown" }
  • name: "solutions"
    label: "Solutions"
    preview: SolutionPreview
    folder: "src/content/solutions"
    create: true
    editor:
    preview: true
    slug: "{{slug}}"
    format: "frontmatter"
    extension: "mdx"
    fields:

    • { label: "Title", name: "title", widget: "string" }

    - { label: "Subtitle", name: "subtitle", widget: "string", required: false }

    • { label: "Description", name: "description", widget: "string", required: false }
    • { label: "Icon", name: "icon", widget: "image", required: false }
    • { label: "Cover Image", name: "cover", widget: "image", required: false }
    • { label: "Call to Action Text", name: "cta", widget: "hidden", required: false }
    • { label: "CTA Link", name: "ctaLink", widget: "hidden", required: false }
    • { label: "Body", name: "body", widget: "markdown" }
  • name: "templates"
    label: "Templates"
    folder: "src/content/templates"
    create: true
    editor:
    preview: true
    slug: "{{slug}}"
    format: "frontmatter"
    extension: "mdx"
    fields:

    • { label: "Title", name: "title", widget: "string" }
    • { label: "Image", name: "image", widget: "image" }
    • { label: "Date", name: "date", widget: "datetime", date_format: "YYYY-MM-DD", time_format: false, required: false }

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugcode to address defects in shipped code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions