Enhancement: add TypeScript generics support for custom renderer return types
Open
Nobody has claimed this yet.
proposal
- Dominant language
- JavaScript
- Stars
- 37.2k
- Forks
- 3.7k
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 19
Description
Feature request
The marked library currently uses loose TypeScript types for custom renderers. Adding proper generics for return types would improve type safety when extending the renderer.
Proposed solution
Allow renderer methods to specify their return type via generics, enabling type-safe custom rendering.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the TypeScript definitions for custom renderers and reviewing how their return types are currently declared. Define the generic behavior and verify that renderer extensions receive type-safe return types, adding or updating type checks as needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100