Output code tag around pre. Closes #181
This commit is contained in:
parent
db58c1216b
commit
4f6f4bfae9
@ -6,7 +6,10 @@ import registry from '../../lib/registry';
|
||||
const defaultSchema = {
|
||||
[BLOCKS.DOCUMENT]: 'article',
|
||||
[BLOCKS.TEXT]: null,
|
||||
[BLOCKS.CODE]: 'code',
|
||||
[BLOCKS.CODE]: ({ token }) => {
|
||||
const className = token.getIn(['data', 'syntax']) && `language-${ token.getIn(['data', 'syntax']) }`;
|
||||
return <pre><code className={className} dangerouslySetInnerHTML={{ __html: token.get('tokens').map(token => token.text).join('') }} /></pre>;
|
||||
},
|
||||
[BLOCKS.BLOCKQUOTE]: 'blockquote',
|
||||
[BLOCKS.PARAGRAPH]: 'p',
|
||||
[BLOCKS.FOOTNOTE]: 'footnote',
|
||||
|
Loading…
x
Reference in New Issue
Block a user