mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-31 18:46:07 +01:00 
			
		
		
		
	This PR allows for custom link protocols to be declared and rendered in markdown.
A new extension point markdown-renderer.link.protocol allows for renderers to hook into the api and implement any custom protocol.
Example:
[description](myprotocol:somelink)
binder.bind("markdown-renderer.link.protocol", { protocol: "myprotocol", renderer: MyProtocolRenderer })
This renderer functions similar to link renderers and receives the href and the description. The latter as the children property.
This PR also fixes two bugs where external- and anchor links were not correctly rendered in pull requests by the review-plugin.
Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			328 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			328 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { FC } from "react";
 | |
| 
 | |
| export type ProtocolLinkRendererProps = {
 | |
|   protocol: string;
 | |
|   href: string;
 | |
| };
 | |
| 
 | |
| export type ProtocolLinkRendererExtension = {
 | |
|   protocol: string;
 | |
|   renderer: FC<ProtocolLinkRendererProps>;
 | |
| };
 | |
| 
 | |
| export type ProtocolLinkRendererExtensionMap = {
 | |
|   [protocol: string]: FC<ProtocolLinkRendererProps>;
 | |
| }
 |