Skip to content

Commit

Permalink
Update schema creation
Browse files Browse the repository at this point in the history
  • Loading branch information
inlinestyle authored Sep 6, 2017
1 parent 6b64c59 commit 7a94d01
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ import RemarkLowlight from 'remark-react-lowlight';

import js from 'highlight.js/lib/languages/javascript';

import merge from 'deepmerge';
import sanitizeGhSchema from 'hast-util-sanitize/lib/github.json';

const schema = merge(sanitizeGhSchema, { attributes: { 'code': ['className'] } });
import githubSchema from 'hast-util-sanitize/lib/github.json';

const schema = Object.assign({}, githubSchema, {
attributes: Object.assign({}, githubSchema.attributes, {
code: [
...(githubSchema.attributes.code || []),
'className'
]
})
});

...
{remark().use(reactRenderer, {
Expand Down

0 comments on commit 7a94d01

Please sign in to comment.