decaporg / decaporg/decap-cms

Markdown widget parses backslash wrong in headers

Open
#6,707 5 comments 0 reactions 1 assignee Assigned to @piyush6077 View on GitHub
area: extensions/widgets/markdown type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Describe the bug**
The Markdown widget fails to parse a backslash at the end of a first header line as a multi-line header. However it inserts the backslash it self with Shift + Enter

**To Reproduce**

1. Open a page with a markdown editor in rich text mode
2. Enter "First Second"
3. Insert line break with Shift + Enter after "First"
4. Select markdown mode
5. Observe a backslash is present in markdown
6. Select RichText mode
7. Observe that now a backslash is present the markup is not showing as a multi-line

**Expected behavior**
The Multi-Line header should be shown correctly.

**Screenshots**
![image](https://user-images.githubusercontent.com/5088045/221825071-de7eb9b4-ac64-4e0a-9f80-cb309415074f.png)
![image](https://user-images.githubusercontent.com/5088045/221825168-f28084c6-11b3-4d66-9ac5-afa456548b30.png)
![image](https://user-images.githubusercontent.com/5088045/221825225-96b305d7-db42-4118-b662-0f69b0b9ab09.png)

**Applicable Versions:**

- netlify-cms-app 2.15.72
- netlify-cms-core 2.55.2
- netlify-cms 2.10.192
- Git provider: GitLab
- OS: Win 10
- Browser version v1.48.171 (Chromium 110.0.5481.177)

**CMS configuration**

```
Widget Config:
- { label: 'Textkörper', name: 'body', widget: 'markdown' }
```

**Additional context**
[Related issue](https://github.com/netlify/netlify-cms/issues/512) on backslash behavior in paragraphs

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.