Skip to content

Commit e7a8d78

Browse files
DavidWellsdemshy
authored andcommitted
Potential Fix for #7152 (Slate crashing) (#7153)
* Potential Fix for #7152 * fix: update e2e tests for soft breaks --------- Co-authored-by: Anze Demsar <[email protected]>
1 parent 10f1240 commit e7a8d78

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

cypress/e2e/markdown_widget_enter_spec.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('Markdown widget breaks', () => {
8989
.enter({ shift: true })
9090
.confirmMarkdownEditorContent(`
9191
<p>
92-
92+
<br>
9393
</p>
9494
`);
9595
});
@@ -98,7 +98,10 @@ describe('Markdown widget breaks', () => {
9898
.enter({ shift: true, times: 4 })
9999
.confirmMarkdownEditorContent(`
100100
<p>
101-
101+
<br>
102+
<br>
103+
<br>
104+
<br>
102105
</p>
103106
`);
104107
});

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
"test:unit": "cross-env NODE_ENV=test jest --no-cache",
1616
"test:e2e": "npm run build:demo && npm run test:e2e:run",
1717
"test:e2e:ci": "npm run build:demo && npm run test:e2e:run-ci",
18-
"test:e2e:dev": "run-p test:e2e:start test:e2e:exec-dev",
19-
"test:e2e:start": "start-test develop 8080",
18+
"test:e2e:dev": "start-test develop 8080 test:e2e:exec-dev",
2019
"test:e2e:serve": "http-server -c-1 dev-test",
2120
"test:e2e:exec": "cypress run --browser chrome --headless",
2221
"test:e2e:exec-ci": "node cypress/run.mjs",

packages/decap-cms-widget-markdown/src/MarkdownControl/renderers.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,12 @@ function ThematicBreak(props) {
205205
}
206206

207207
function Break(props) {
208-
return <br {...props.attributes} />;
208+
return (
209+
<>
210+
<br {...props.attributes} />
211+
{props.children}
212+
</>
213+
);
209214
}
210215

211216
function BulletedList(props) {

0 commit comments

Comments
 (0)