markedjs / markedjs/marked

Enhancement: add TypeScript generics support for custom renderer return types

Open
#3,974 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.