unified

Project: remarkjs/remark-comment-config

Package: remark-comment-config@5.1.1

  1. Dependencies: 1·Dependents: 9
  2. remark plugin to configure it with comments
  1. remark 192
  2. unified 152
  3. plugin 133
  4. markdown 122
  5. mdast 77
  6. remark-plugin 73
  7. comment 7
  8. options 2
  9. config 2
  10. settings 2

remark-comment-config

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to configure it with comments.

Install

npm:

npm install remark-comment-config

Use

Say we have the following file, example.md:

<!--remark commonmark bullet="*"-->

1) Commonmark list (this is a parse setting)

- List item (this is a stringify setting)

And our script, example.js, looks as follows:

var vfile = require('to-vfile')
var remark = require('remark')
var commentConfig = require('remark-comment-config')

remark()
  .use(commentConfig)
  .process(vfile.readSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

<!--remark commonmark bullet="*"-->

1.  Commonmark list (this is a parse setting)

*   List item (this is a stringify setting)

API

remark().use(commentConfig)

Plugin to configure remark with comments. Parses comments, such as <!--remark foo="bar" baz-->, and passes the “attributes” as parse and stringify.

This is essentially the same as remark-yaml-config, except that comments are invisible when rendering to HTML (such as on GitHub).

Security

Use of remark-comment-config can change how Markdown is parsed or compiled. If the Markdown is user provided, this may open you up to a cross-site scripting (XSS) attack.

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer