Skip to content

Commit 6d8d424

Browse files
committed
Merge remote-tracking branch 'y-tsubuku/avoid_changing_block_if_a_block_is_code' into develop
2 parents 204acd1 + 8909bbc commit 6d8d424

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modifiers/handleBlockType.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const handleBlockType = (editorState, character) => {
2020
const line = [text.slice(0, position), character, text.slice(position)].join('');
2121
const blockType = RichUtils.getCurrentBlockType(editorState);
2222
for (let i = 1; i <= 6; i += 1) {
23-
if (line.indexOf(`${sharps(i)} `) === 0) {
23+
if (line.indexOf(`${sharps(i)} `) === 0 && blockType !== 'code-block') {
2424
return changeCurrentBlockType(editorState, blockTypes[i], line.replace(/^#+\s/, ''));
2525
}
2626
}

0 commit comments

Comments
 (0)