1
1
import Asterisk from '@spectrum-icons/workflow/Asterisk' ;
2
2
import { getDoc } from 'globals-docs' ;
3
3
import Lowlight from 'react-lowlight' ;
4
+ import Markdown from 'markdown-to-jsx' ;
4
5
import React , { useContext } from 'react' ;
5
6
import styles from './docs.css' ;
6
7
import tableStyles from '@adobe/spectrum-css-temp/components/table/vars.css' ;
@@ -190,6 +191,14 @@ function LinkType({id}) {
190
191
return < a href = { '#' + id } data-link = { id } className = { `${ styles . colorLink } token hljs-name` } > { value . name } </ a > ;
191
192
}
192
193
194
+ function renderHTMLfromMarkdown ( description ) {
195
+ if ( description ) {
196
+ return < Markdown > { description } </ Markdown > ;
197
+ } else {
198
+ return '' ;
199
+ }
200
+ }
201
+
193
202
export function InterfaceType ( { properties, showRequired, showDefault} ) {
194
203
return (
195
204
< table className = { `${ tableStyles [ 'spectrum-Table' ] } ${ tableStyles [ 'spectrum-Table--quiet' ] } ${ styles . propTable } ` } >
@@ -209,7 +218,7 @@ export function InterfaceType({properties, showRequired, showDefault}) {
209
218
< span className = "token hljs-attr" > { prop . name } </ span >
210
219
</ code >
211
220
{ ! prop . optional && showRequired
212
- ? < Asterisk size = "XXS" UNSAFE_className = { styles . requiredIcon } alt = "Required" />
221
+ ? < Asterisk size = "XXS" UNSAFE_className = { styles . requiredIcon } alt = "Required" />
213
222
: null
214
223
}
215
224
</ td >
@@ -226,7 +235,7 @@ export function InterfaceType({properties, showRequired, showDefault}) {
226
235
}
227
236
</ td >
228
237
}
229
- < td className = { tableStyles [ 'spectrum-Table-cell' ] } > { prop . description } </ td >
238
+ < td className = { tableStyles [ 'spectrum-Table-cell' ] } > { renderHTMLfromMarkdown ( prop . description ) } </ td >
230
239
</ tr >
231
240
) ) }
232
241
</ tbody >
0 commit comments