Skip to content

Allow disabling specific parts of GFM #3

Closed as not planned
Closed as not planned
@bengry

Description

@bengry

Initial checklist

Problem

While some options are exposed to consumers, none of them allow controlling specific parts of GFM. e.g. if I want the entire suite besides Autolink Literals support, I have to fork this package (which is not very big, but still) and have something like this:

export function gfmFromMarkdown({ autolinkLiteral = true }: { autolinkLiteral?: boolean }) {
  return [
    autolinkLiteral && gfmAutolinkLiteralFromMarkdown(),
    gfmFootnoteFromMarkdown(),
    gfmStrikethroughFromMarkdown(),
    gfmTableFromMarkdown(),
    gfmTaskListItemFromMarkdown()
  ].filter(Boolean);
}

export function gfmToMarkdown({ autolinkLiteral = true, ...options }) {
  return {
    extensions: [
      autolinkLiteral && gfmAutolinkLiteralToMarkdown(),
      gfmFootnoteToMarkdown(options),
      gfmStrikethroughToMarkdown(),
      gfmTableToMarkdown(options),
      gfmTaskListItemToMarkdown()
    ].filter(Boolean);
  }
}

To allow this behavior. The same goes for any of the other plugins - table, list items, etc..

It would be nice if we could disable some of them via a simple boolean flag as suggested above.

Current solutions

Fork/patch the package to support this

Proposed solutions

Add an opt-out option from any of the plugins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🙅 no/wontfixThis is not (enough of) an issue for this project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions