forked from andyburke/autonomous.contact
		
	
		
			
				
	
	
		
			13 lines
		
	
	
	
		
			341 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
	
		
			341 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| function embed_image(link_info) {
 | |
| 	if (typeof link_info.extension !== "string") {
 | |
| 		return;
 | |
| 	}
 | |
| 
 | |
| 	const is_image = get_mime_types(link_info.extension).shift()?.indexOf("image") === 0;
 | |
| 
 | |
| 	if (!is_image) {
 | |
| 		return;
 | |
| 	}
 | |
| 
 | |
| 	return `<div class="embed-container image"><img src="${link_info.url}" alt="An image from ${link_info.domain}" /></div>`;
 | |
| }
 |