New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

front-matter-markdown

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

front-matter-markdown - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

8

lib/index.js

@@ -36,2 +36,5 @@ (function() {

result = result.data;
if (!(result.content || aOptions.content === false)) {
defineProperty(result, 'content', aContent);
}
if (isString(aOptions.heading)) {

@@ -42,5 +45,8 @@ headings = [aOptions.heading];

} else {
headings = ['toc', 'table of content', 'summary'];
headings = ['toc', /table of content/, 'summary'];
}
compiled = markdown.lexer(aContent);
if (aOptions.content !== false) {
defineProperty(result, '$compiled', compiled);
}
if (aOptions.toc !== false) {

@@ -47,0 +53,0 @@ toc = getTocFromList(compiled, headings);

2

package.json
{
"name": "front-matter-markdown",
"description": "get the config and toc object from the markdown string.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/snowyu/front-matter-markdown.js",

@@ -6,0 +6,0 @@ "repository": {

@@ -33,3 +33,3 @@ ## front-matter-markdown [![npm](https://img.shields.io/npm/v/front-matter-markdown.svg)](https://npmjs.org/package/front-matter-markdown)

"""
console.log(parseMarkdown markdownStr)
console.log(JSON.stringify parseMarkdown(markdownStr), null, 1)
```

@@ -40,2 +40,23 @@

```bash
{
"title": "this is a title",
"ordered": false,
"contents": [
{
"title": "Directory",
"path": "./dir1",
"ordered": false,
"contents": [
{
"title": "Directory2",
"path": "/dir2"
}
]
},
{
"title": "Directory3",
"path": "#inline"
}
]
}
```

@@ -52,2 +73,5 @@

* `aOptions`*(Object)*:
* `content` *(Boolean)*: whether extract the markdown content from configuration.
defaults to true. it will store the compiled markdown to `$compiled` too.
* **Note**: the `content` and `$compiled` attributes are non-enumerable.
* `toc` *(Boolean)*: whether extract the directory from the list in the specified heading.

@@ -54,0 +78,0 @@ defaults to true.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc