From 7a6de8725c21343f265f95b5ab916c586040dec6 Mon Sep 17 00:00:00 2001 From: Nandu Date: Mon, 21 Jan 2019 21:27:43 -0500 Subject: [PATCH] Add break in the Switch statement for Custom Formatting Walkthrough (#2550) The Custom Formatting Walkthrough does not work as expected. When Ctrl + B is pressed it applies both Bold and Code styles to the content. This is because of the case statement running beyond the Bold case due to the absence of a break keyword. --- docs/walkthroughs/applying-custom-formatting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/walkthroughs/applying-custom-formatting.md b/docs/walkthroughs/applying-custom-formatting.md index 5c492c211..cd4d0d3cf 100644 --- a/docs/walkthroughs/applying-custom-formatting.md +++ b/docs/walkthroughs/applying-custom-formatting.md @@ -72,12 +72,14 @@ class App extends React.Component { case 'b': { event.preventDefault() editor.addMark('bold') + break } // When "`" is pressed, keep our existing code block logic. case '`': { const isCode = editor.value.blocks.some(block => block.type == 'code') event.preventDefault() editor.setBlocks(isCode ? 'paragraph' : 'code') + break } // Otherwise, let other plugins handle it. default: {