A fork of remark-gfm with configurable plugin options to enable or disable specific GitHub Flavored Markdown (GFM) features.
Enable or disable, these underlying features: autolink literals, footnotes, strikethrough, tables, and task list items.
You can customize both plugin features and extension options by passing an options
object to remarkGfm
. The options
object can include plugin enable/disable settings under the plugins
property and extension-specific options at the top level.
import { remark } from 'remark';
import remarkGfm from 'remark-gfm-configurable';
const options = {
plugins: {
table: false, // Disable tables
footnote: false, // Disable footnotes
},
singleTilde: true, // Extension option for strikethrough
tableCellPadding: false, // Extension option for tables (ignored since tables are disabled)
};
remark()
.use(remarkGfm, options)
.process(markdown)
.then((file) => {
console.log(String(file));
});
In this example:
- Plugin Options: We disable
table
andfootnote
features by setting them tofalse
under theplugins
property. - Extension Options: We set
singleTilde: true
to allow single tilde strikethrough.
The options
object passed to remarkGfm
can contain both plugin options (to enable or disable specific GFM features) and extension options (for fine-grained control over individual extensions).
interface Options extends RemarkGfmOptions {
plugins?: {
autolinkLiteral?: boolean; // Default: true
footnote?: boolean; // Default: true
strikethrough?: boolean; // Default: true
table?: boolean; // Default: true
tasklist?: boolean; // Default: true
},
}
const options = {
plugins: {
autolinkLiteral: true,
footnote: false, // Disable footnotes
strikethrough: true,
table: true,
tasklist: true,
},
// Extension options
singleTilde: true, // Strikethrough option
tableCellPadding: false, // Table option
tablePipeAlign: true, // Table option
};
Contributions are welcome! If you have suggestions or find a bug, please open an issue or submit a pull request on GitHub.
- Titus Wormer for creating the original
remark-gfm
package. - The remark and unified communities for their invaluable work.