Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mdast-util-heading-style

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast-util-heading-style - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

26

package.json
{
"name": "mdast-util-heading-style",
"version": "1.0.5",
"description": "Utility to get the style of an mdast heading",
"version": "1.0.6",
"description": "mdast utility to get the style of a heading",
"license": "MIT",
"keywords": [
"unist",
"mdast",
"mdast-util",
"util",
"utility",
"markdown",
"node",
"heading",
"style",
"util",
"utility"
"style"
],
"repository": "syntax-tree/mdast-util-heading-style",
"bugs": "https://github.com/syntax-tree/mdast-util-heading-style/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",

@@ -27,10 +33,10 @@ "contributors": [

"browserify": "^16.0.0",
"nyc": "^14.0.0",
"nyc": "^15.0.0",
"prettier": "^1.0.0",
"remark": "^10.0.0",
"remark-cli": "^6.0.0",
"remark-preset-wooorm": "^5.0.0",
"remark": "^11.0.0",
"remark-cli": "^7.0.0",
"remark-preset-wooorm": "^6.0.0",
"tape": "^4.0.0",
"tinyify": "^2.0.0",
"xo": "^0.24.0"
"xo": "^0.26.0"
},

@@ -37,0 +43,0 @@ "scripts": {

@@ -21,14 +21,17 @@ # mdast-util-heading-style

## Usage
## Use
```js
var style = require('mdast-util-heading-style')
var remark = require('remark')()
var unified = require('unified')
var parse = require('remark-parse')
style(remark.parse('# ATX').children[0]) // => 'atx'
style(remark.parse('# ATX #\n').children[0]) // => 'atx-closed'
style(remark.parse('ATX\n===').children[0]) // => 'setext'
var processor = unified().use(parse)
style(remark.parse('### ATX').children[0]) // => null
style(remark.parse('### ATX').children[0], 'setext') // => 'setext'
style(processor.parse('# ATX').children[0]) // => 'atx'
style(processor.parse('# ATX #\n').children[0]) // => 'atx-closed'
style(processor.parse('ATX\n===').children[0]) // => 'setext'
style(processor.parse('### ATX').children[0]) // => null
style(processor.parse('### ATX').children[0], 'setext') // => 'setext'
```

@@ -53,2 +56,7 @@

## Security
Use of `mdast-util-heading-style` does not involve [**hast**][hast] so there are
no openings for [cross-site scripting (XSS)][xss] attacks.
## Contribute

@@ -60,4 +68,4 @@

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

@@ -93,3 +101,3 @@

[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg

@@ -113,1 +121,5 @@ [chat]: https://spectrum.chat/unified/syntax-tree

[node]: https://github.com/syntax-tree/unist#node
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
[hast]: https://github.com/syntax-tree/hast
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