Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

remark-comment-config

5.1.1 • Public • Published

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.

Related

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

Install

npm i remark-comment-config

DownloadsWeekly Downloads

2,078

Version

5.1.1

License

MIT

Unpacked Size

8.53 kB

Total Files

4

Last publish

Collaborators

  • avatar
  • avatar