Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown flavors + options #1225

Open
joshbruce opened this issue Apr 16, 2018 · 3 comments
Open

Markdown flavors + options #1225

joshbruce opened this issue Apr 16, 2018 · 3 comments

Comments

@joshbruce
Copy link
Member

joshbruce commented Apr 16, 2018

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.

@UziTech
Copy link
Member

UziTech commented Apr 16, 2018

I would think most users would expect commonmark compliance therefore gfm and pedantic should be options but the default would be commonmark

@joshbruce
Copy link
Member Author

Having pedantic and gfm as flags still runs into the same issue of cross-flagging and could add some bloat to the code to account for it. Maybe:

{
   flavor: commonmark|gfm|daring
}

From a UX perspective, trying to take the cognitive load off the user. Seems most of our users are thinking GFM is the default. (Note: I haven't gone through all the options yet to figure out what they do exactly, will definitely try to before we get much closer to 1.x.)

Note: Looking to deprecate the flag entirely.

@jhpratt
Copy link

jhpratt commented Apr 18, 2018

Somewhat related, I'm going to be using this to render for reddit posts, so options like this would be super useful.

@joshbruce joshbruce mentioned this issue May 1, 2018
6 tasks
@UziTech UziTech added this to To Do in vNext via automation Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
vNext
To Do
Development

No branches or pull requests

3 participants