mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-27 01:34:30 +03:00
Fix problem with span
inside inline code
React doesn't allow a `span` inside an inline `code` element and throws an error in dev mode.
This commit is contained in:
parent
5e1a10f617
commit
a280729491
|
@ -94,12 +94,12 @@ export const TypeAnnotation = ({ lang = 'python', link = true, children }) => {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return (
|
return (
|
||||||
<code className={annotClassNames} aria-label="Type annotation">
|
<span className={annotClassNames} role="code" aria-label="Type annotation">
|
||||||
{elements.map((el, i) => (
|
{elements.map((el, i) => (
|
||||||
<Fragment key={i}>{linkType(el, !!link)}</Fragment>
|
<Fragment key={i}>{linkType(el, !!link)}</Fragment>
|
||||||
))}
|
))}
|
||||||
{meta && <span className={classes['type-annotation-meta']}>{meta}</span>}
|
{meta && <span className={classes['type-annotation-meta']}>{meta}</span>}
|
||||||
</code>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user