Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document readme.md serious error about the options of delimiters #91

Open
donaldtone opened this issue Mar 3, 2019 · 1 comment
Open
Labels
docs Updates and improvements to the documentation.

Comments

@donaldtone
Copy link

donaldtone commented Mar 3, 2019

options.delimiters
Type: String
Default: ---

Open and close delimiters can be passed in as an array of strings.

Example:

// format delims as a string
matter.read('file.md', {delims: '~~~'});
// or an array (open/close)
matter.read('file.md', {delims: ['~~~', '~~~']});

the example is wrong.
it should use delimiters instead of delims.

like that:

Example:

// format delims as a string
matter.read('file.md', {delimiters: '~~~'});
// or an array (open/close)
matter.read('file.md', {delimiters: ['~~~', '~~~']});
@robertmassaioli robertmassaioli added the docs Updates and improvements to the documentation. label Apr 19, 2019
Aidiakapi added a commit to Aidiakapi/gray-matter that referenced this issue Jan 28, 2020
Change README.md to use the `delimiters` config option, instead of the deprecated `delims`.
@eikowagenknecht
Copy link

eikowagenknecht commented Feb 18, 2024

I checked the code. Indeed delims is still the primary source and delimiters is only used when delims is not present.

  // ensure that delimiters are an array
  opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || '---');
  if (opts.delimiters.length === 1) {
    opts.delimiters.push(opts.delimiters[0]);
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Updates and improvements to the documentation.
Projects
None yet
Development

No branches or pull requests

3 participants