@@ -28,23 +28,22 @@ const addImplementationDetails = (check) => {
2828 return content
2929}
3030
31- const addContent = ( title , description , url ) => {
32- if ( ! description && ! url ) {
33- return ''
34- }
31+ const addContent = ( title , urls = [ ] ) => {
32+ let content = ''
33+ if ( urls . length ) {
34+ content = urls . map ( ( item ) => {
35+ return `- ${ title } : [${ item . name } ](${ item . url } )`
36+ } ) . join ( '\n' )
37+ }
3538
36- if ( url ) {
37- return `- ${ title } : [${ description } ](${ url } )`
38- }
39-
40- return `- ${ title } : ${ description } `
39+ return content
4140}
4241
4342const renderDetails = ( check ) => {
4443 const implementationDetails = addImplementationDetails ( check )
45- const mitreDetails = addContent ( 'Mitre' , check . mitre_description , check . mitre_url )
46- const sourcesDetails = addContent ( 'Sources' , check . sources_description , check . sources_url )
47- const howToDetails = addContent ( 'How To' , check . how_to_description , check . how_to_url )
44+ const mitreDetails = addContent ( 'Mitre' , check . resources . mitre )
45+ const sourcesDetails = addContent ( 'Sources' , check . resources . sources )
46+ const howToDetails = addContent ( 'How To' , check . resources . how_to )
4847 let content = '## Details\n'
4948 content += `- Default Category: ${ check . default_section_name } \n`
5049 content += `- Default Priority Group: ${ check . default_priority_group } \n`
0 commit comments