Logo
Explore Help
Register Sign In
Nemcio/SCM-Manager
1
0
Fork 0
You've already forked SCM-Manager
mirror of https://github.com/scm-manager/scm-manager.git synced 2025-11-01 02:55:56 +01:00
Code Issues Packages Projects Releases Activity
Files
32b268e6f54c47c521eda63c90a6190d0b6abb2d
SCM-Manager/scm-ui/ui-components/src/markdown/markdownExtensions.ts

16 lines
328 B
TypeScript
Raw Normal View History

add extension point for custom link protocol renderers in markdown (#1639) 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>
2021-04-29 13:15:22 +02:00
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>;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.0 Page: 185ms Template: 6ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API