mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-05 06:00:36 +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)
|
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 tree
|
||||||
}
|
}
|
||||||
return transformer
|
return transformer
|
||||||
|
|
|
@ -37,7 +37,6 @@ export const remarkComponents = {
|
||||||
p: P,
|
p: P,
|
||||||
pre: Pre,
|
pre: Pre,
|
||||||
code: Code,
|
code: Code,
|
||||||
inlineCode: InlineCode,
|
|
||||||
del: TypeAnnotation,
|
del: TypeAnnotation,
|
||||||
table: Table,
|
table: Table,
|
||||||
img: Image,
|
img: Image,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user