turndown icon indicating copy to clipboard operation
turndown copied to clipboard

Update demo default settings with atx headingStyle etc.

Open Robbie-Cook opened this issue 3 years ago • 3 comments

setext format is not as commonly used as atx, and I had no idea it existed. Can we change the example demo to

const turndownService = new TurndownService({ headingStyle: "atx" });

Robbie-Cook avatar Jul 05 '21 09:07 Robbie-Cook

I have a few similar ideas a few days ago. I want to refactor the demo a little more, especially add the GFM plugin, that's why I haven't touched it so far. The issue is that the demo reflects Turndown's defaults, so it would be inconcistent. :/ I'd like to change Turndown defaults, but it has to be done with a major version. So I guess we'd need to sacrifice demo consistency temporarily.

The suitable defaults are as follows IMO:

  headingStyle: 'atx',
  hr: '---',
  bulletListMarker: '*',
  codeBlockStyle: 'fenced',
  fence: '```',
  emDelimiter: '*', // unlike underscore, this works also intra-word
  strongDelimiter: '**', // unlike underscores, this works also intra-word
  linkStyle: 'inlined',
  linkReferenceStyle: 'full',
  br: '  ',
  preformattedCode: false,

What do you think?

martincizek avatar Jul 05 '21 12:07 martincizek

Right, thank you for your comment @martincizek . I understand you can't change the default -- makes sense. I disagree with

The issue is that the demo reflects Turndown's defaults, so it would be inconcistent

though. Having a demo with an option set is, in my mind, not inconsistent. It's more consistent, because it more closely matches most people's idea of markdown

Robbie-Cook avatar Jul 07 '21 03:07 Robbie-Cook

The suitable defaults are as follows IMO:

This is such an underrated comment, thanks for sharing.

samheutmaker avatar Feb 25 '23 16:02 samheutmaker