mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 02:55:56 +01:00
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>
This commit is contained in:
committed by
GitHub
parent
8f91c217fc
commit
32b268e6f5
@@ -62,6 +62,17 @@ The following extension points are provided for the frontend:
|
||||
- Dynamic extension point for custom language-specific renderers
|
||||
- Overrides the default Syntax Highlighter
|
||||
- Used by the Markdown Plantuml Plugin
|
||||
### markdown-renderer.link.protocol
|
||||
- Define custom protocols and their renderers for links in markdown
|
||||
|
||||
Example:
|
||||
```markdown
|
||||
[description](myprotocol:somelink)
|
||||
```
|
||||
|
||||
```typescript
|
||||
binder.bind("markdown-renderer.link.protocol", { protocol: "myprotocol", renderer: MyProtocolRenderer })
|
||||
```
|
||||
|
||||
# Deprecated
|
||||
|
||||
|
||||
Reference in New Issue
Block a user