11import Asterisk from '@spectrum-icons/workflow/Asterisk' ;
22import { getDoc } from 'globals-docs' ;
33import Lowlight from 'react-lowlight' ;
4+ import Markdown from 'markdown-to-jsx' ;
45import React , { useContext } from 'react' ;
56import styles from './docs.css' ;
67import tableStyles from '@adobe/spectrum-css-temp/components/table/vars.css' ;
@@ -190,6 +191,14 @@ function LinkType({id}) {
190191 return < a href = { '#' + id } data-link = { id } className = { `${ styles . colorLink } token hljs-name` } > { value . name } </ a > ;
191192}
192193
194+ function renderHTMLfromMarkdown ( description ) {
195+ if ( description ) {
196+ return < Markdown > { description } </ Markdown > ;
197+ } else {
198+ return '' ;
199+ }
200+ }
201+
193202export function InterfaceType ( { properties, showRequired, showDefault} ) {
194203 return (
195204 < table className = { `${ tableStyles [ 'spectrum-Table' ] } ${ tableStyles [ 'spectrum-Table--quiet' ] } ${ styles . propTable } ` } >
@@ -209,7 +218,7 @@ export function InterfaceType({properties, showRequired, showDefault}) {
209218 < span className = "token hljs-attr" > { prop . name } </ span >
210219 </ code >
211220 { ! prop . optional && showRequired
212- ? < Asterisk size = "XXS" UNSAFE_className = { styles . requiredIcon } alt = "Required" />
221+ ? < Asterisk size = "XXS" UNSAFE_className = { styles . requiredIcon } alt = "Required" />
213222 : null
214223 }
215224 </ td >
@@ -226,7 +235,7 @@ export function InterfaceType({properties, showRequired, showDefault}) {
226235 }
227236 </ td >
228237 }
229- < td className = { tableStyles [ 'spectrum-Table-cell' ] } > { prop . description } </ td >
238+ < td className = { tableStyles [ 'spectrum-Table-cell' ] } > { renderHTMLfromMarkdown ( prop . description ) } </ td >
230239 </ tr >
231240 ) ) }
232241 </ tbody >
0 commit comments