From bd7ee85c9b25268125b14643540bfecf4e6eb3a7 Mon Sep 17 00:00:00 2001 From: Mate Paiva Date: Wed, 6 Mar 2019 21:45:08 +0000 Subject: [PATCH] Fix missing break in last example (#2629) In the last chunk of code, it was missing the `break` (or `return`). So, if used as is, the bold key will toggle the `code` feature as well. --- 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 cd4d0d3cf..4b4b22ce2 100644 --- a/docs/walkthroughs/applying-custom-formatting.md +++ b/docs/walkthroughs/applying-custom-formatting.md @@ -146,11 +146,13 @@ class App extends React.Component { case 'b': { event.preventDefault() editor.toggleMark('bold') + break } case '`': { const isCode = editor.value.blocks.some(block => block.type == 'code') event.preventDefault() editor.setBlocks(isCode ? 'paragraph' : 'code') + break } default: { return next()