Disable browser spellchecking with code

This commit is contained in:
Jori Lallo
2017-11-26 20:34:45 -08:00
parent 8dd79f8b13
commit a373931ebe
2 changed files with 4 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ export default function Code({ children, node, readOnly, attributes }: Props) {
const language = node.data.get('language') || 'javascript';
return (
<Container {...attributes}>
<Container {...attributes} spellCheck={false}>
{readOnly && <CopyButton text={node.text} />}
<Pre className={`language-${language}`}>
<code className={`language-${language}`}>{children}</code>

View File

@@ -2,7 +2,9 @@
import styled from 'styled-components';
import { color } from 'shared/styles/constants';
const InlineCode = styled.code`
const InlineCode = styled.code.attrs({
spellCheck: false,
})`
padding: 0.25em;
background: ${color.smoke};
border-radius: 4px;