mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
Readd InlineCode
component
MDX2 removed the `inlineCode` component > The special component name `inlineCode` was removed, we recommend to use `pre` for the block version of code, and code for both the block and inline versions Source: https://mdxjs.com/migrating/v2/#update-mdx-content
This commit is contained in:
parent
799013c4cf
commit
049279657a
|
@ -66,6 +66,19 @@ function remarkCodeBlocks(userOptions = {}) {
|
|||
node.data.hProperties = Object.assign({}, hProps, attrs)
|
||||
}
|
||||
})
|
||||
|
||||
visit(tree, 'inlineCode', (node) => {
|
||||
node.type = 'mdxJsxTextElement'
|
||||
node.name = 'InlineCode'
|
||||
node.children = [
|
||||
{
|
||||
type: 'text',
|
||||
value: node.value,
|
||||
},
|
||||
]
|
||||
node.data = { _mdxExplicitJsx: true }
|
||||
})
|
||||
|
||||
return tree
|
||||
}
|
||||
return transformer
|
||||
|
|
|
@ -37,7 +37,6 @@ export const remarkComponents = {
|
|||
p: P,
|
||||
pre: Pre,
|
||||
code: Code,
|
||||
inlineCode: InlineCode,
|
||||
del: TypeAnnotation,
|
||||
table: Table,
|
||||
img: Image,
|
||||
|
|
Loading…
Reference in New Issue
Block a user