decaporg / decaporg/decap-cms

Carriage return chars end up in the repository when editing markdown on Windows

Open
#1,437 3 comments 4 reactions 0 assignees View on GitHub
pinned
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**- Do you want to request a *feature* or report a *bug*?**

*bug*

**- What is the current behavior?**

When pasting multi-line rich text into a markdown editor on Windows, carriage return characters ends up being added to the yaml frontmatter etc.

For now I've worked around this by applying a regexp to the serialized markdown: https://github.com/papandreou/netlify-cms/commit/4ce5576812abc067e7401b47eb33096917e0d145

**- If the current behavior is a bug, please provide the steps to reproduce.**

1. Launch Chrome on Windows
2. Copy some multi-line styled text from a website to the clipboard
3. Paste the text into a markdown widget
4. Click "Publish"

Look into the file in the github repo, and it will contain something like:

```yaml
myMarkdownField: "First paragraph\r\n\n\r\n\nSecond paragraph"
```

**- What is the expected behavior?**

That those newlines are somehow normalized, maybe according to a setting in `config.yml`. Or it could use `.editorconfig`.

**- Please mention your versions where applicable.**

Netlify CMS version: 1.9.0
Browser version: Chrome 67.0.3396.87/OSX

Node.JS version: 5.6.0
Operating System: Mac OSX 10.13.4 (High Sierra)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.