markedjs / markedjs/marked

Markdown flavors + options

Open
#1,225 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

parser: CommonMark parser: GFM proposal
Dominant language
JavaScript
Stars
37.2k
Forks
3.7k
Avg merge
4d 3h
Merged PRs (30d)
19

Description

Marked version: 0.3.19

Markdown flavor: all

Proposal type: other

What pain point are you perceiving?

How many licks? and too many flavors.

Right now Marked supports, in theory, the following flavors and specifications:

  1. Original (pedantic, Perl - for download here)
  2. CommonMark
  3. GitHub Flavored Markdown (really CommonMark with some extensions)

Marked only allows choosing flavors through the options in the following manner, in theory:

  1. Original (??): { pendantic: true, gfm: true|false }
  2. CommonMark (??): { pedantic: false, gfm: false }
  3. GFM (default): { pedantic: false, gfm: true }

By default, Marked uses GFM. Having said that, there are options to turn off functionality afforded by GFM ({ tables: false }). There are also features and capabilities that go beyond the specifications and help improve the quality of the HTML output ({ xhtml: false }, for example). The Marked default language prefix is not spec-based (looks like it was chosen based on another tool), should be language- not lang-; this assumes that someone should be able to replicate the spec as much as possible without changing any settings, which could help new users understand the mapping between the spec and the code.

What solution are you suggesting?

This is more about conversation and discussion about the remainder of 0.x and the no known issues target. See #1218

My immediate thought would be to possibly change options a bit.

{ 
  pedantic: true|false,
  gfm: true|false,
  commmonmark: true|false
}

This does open up a can of worms as flags are wont to become when used excessively. Therefore, believe stringifying the flavor can help:

{ 
  flavor: gfm|commonmark|cm|daring
  pedantic: true|false,
  gfm: true|false
}

...that's as far at my brain has gone so far.

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

The issue names no files, tests, or entry points. Start by reviewing Marked's current flavor and parser-option handling, then clarify whether named flavors or boolean options are wanted and define the expected behavior for each. Done means the project has an agreed option model and corresponding implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.