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

micromark

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark - npm Package Compare versions

Comparing version 3.0.10 to 3.1.0

7

dev/index.d.ts

@@ -9,10 +9,7 @@ /**

encoding: Encoding,
options?: import('micromark-util-types').Options | undefined
options?: Options
) => string) &
((
value: Value,
options?: import('micromark-util-types').Options | undefined
) => string)
((value: Value, options?: Options) => string)
export type Options = import('micromark-util-types').Options
export type Value = import('micromark-util-types').Value
export type Encoding = import('micromark-util-types').Encoding

@@ -12,2 +12,3 @@ /**

export type CompileContext = import('micromark-util-types').CompileContext
export type Definition = import('micromark-util-types').Definition
export type Compile = import('micromark-util-types').Compile

@@ -26,5 +27,1 @@ export type Handle = import('micromark-util-types').Handle

}
export type Definition = {
destination?: string | undefined
title?: string | undefined
}

@@ -20,2 +20,3 @@ /**

* @typedef {import('micromark-util-types').CompileContext} CompileContext
* @typedef {import('micromark-util-types').Definition} Definition
* @typedef {import('micromark-util-types').Compile} Compile

@@ -35,6 +36,2 @@ * @typedef {import('micromark-util-types').Handle} Handle

* @property {string} [title]
*
* @typedef Definition
* @property {string} [destination]
* @property {string} [title]
*/

@@ -94,3 +91,3 @@

*
* @type {string[][]}
* @type {Array<Array<string>>}
*/

@@ -103,3 +100,3 @@ const buffers = [[]]

*
* @type {Media[]}
* @type {Array<Media>}
*/

@@ -112,3 +109,3 @@ const mediaStack = []

*
* @type {boolean[]}
* @type {Array<boolean>}
*/

@@ -221,3 +218,6 @@ const tightStack = []

*/
const data = {tightStack}
const data = {
tightStack,
definitions
}

@@ -262,3 +262,3 @@ /**

*
* @param {Event[]} events
* @param {Array<Event>} events
* @returns {string}

@@ -269,3 +269,3 @@ */

let start = 0
/** @type {number[]} */
/** @type {Array<number>} */
const listStack = []

@@ -276,5 +276,5 @@ // As definitions can come after references, we need to figure out the media

// then put content after (`body`).
/** @type {Event[]} */
/** @type {Array<Event>} */
let head = []
/** @type {Event[]} */
/** @type {Array<Event>} */
let body = []

@@ -353,3 +353,3 @@

*
* @param {Event[]} slice
* @param {Array<Event>} slice
* @returns {void}

@@ -356,0 +356,0 @@ */

@@ -59,7 +59,7 @@ /**

const columnStart = {}
/** @type {Construct[]} */
/** @type {Array<Construct>} */
const resolveAllConstructs = []
/** @type {Chunk[]} */
/** @type {Array<Chunk>} */
let chunks = []
/** @type {Token[]} */
/** @type {Array<Token>} */
let stack = []

@@ -348,3 +348,3 @@ /** @type {boolean|undefined} */

*
* @param {Construct|Construct[]|ConstructRecord} constructs
* @param {Construct|Array<Construct>|ConstructRecord} constructs
* @param {State} returnState

@@ -355,3 +355,3 @@ * @param {State} [bogusState]

function hook(constructs, returnState, bogusState) {
/** @type {Construct[]} */
/** @type {Array<Construct>} */
let listOfConstructs

@@ -400,3 +400,3 @@ /** @type {number} */

*
* @param {Construct[]} list
* @param {Array<Construct>} list
* @returns {State}

@@ -558,5 +558,5 @@ */

*
* @param {Chunk[]} chunks
* @param {Array<Chunk>} chunks
* @param {Pick<Token, 'start'|'end'>} token
* @returns {Chunk[]}
* @returns {Array<Chunk>}
*/

@@ -568,3 +568,3 @@ function sliceChunks(chunks, token) {

const endBufferIndex = token.end._bufferIndex
/** @type {Chunk[]} */
/** @type {Array<Chunk>} */
let view

@@ -597,3 +597,3 @@

*
* @param {Chunk[]} chunks
* @param {Array<Chunk>} chunks
* @param {boolean} [expandTabs=false]

@@ -604,3 +604,3 @@ * @returns {string}

let index = -1
/** @type {string[]} */
/** @type {Array<string>} */
const result = []

@@ -607,0 +607,0 @@ /** @type {boolean|undefined} */

@@ -34,3 +34,3 @@ /**

const self = this
/** @type {StackItem[]} */
/** @type {Array<StackItem>} */
const stack = []

@@ -37,0 +37,0 @@ let continued = 0

/**
* @param {Event[]} events
* @returns {Event[]}
* @param {Array<Event>} events
* @returns {Array<Event>}
*/
export function postprocess(
events: import('micromark-util-types').Event[]
): import('micromark-util-types').Event[]
events: Array<import('micromark-util-types').Event>
): Array<import('micromark-util-types').Event>
export type Event = import('micromark-util-types').Event

@@ -8,4 +8,4 @@ /**

/**
* @param {Event[]} events
* @returns {Event[]}
* @param {Array<Event>} events
* @returns {Array<Event>}
*/

@@ -12,0 +12,0 @@ export function postprocess(events) {

@@ -13,2 +13,2 @@ /**

end?: boolean | undefined
) => Chunk[]
) => Array<Chunk>

@@ -13,3 +13,3 @@ /**

* @param {boolean} [end=false]
* @returns {Chunk[]}
* @returns {Array<Chunk>}
*/

@@ -37,3 +37,3 @@

function preprocessor(value, encoding, end) {
/** @type {Chunk[]} */
/** @type {Array<Chunk>} */
const chunks = []

@@ -40,0 +40,0 @@ /** @type {RegExpMatchArray|null} */

@@ -11,3 +11,3 @@ /**

export type Encoding = import('micromark-util-types').Encoding
export type Callback = (error?: Error | undefined) => void
export type Callback = (error?: Error) => void
export type MinimalDuplex = Omit<

@@ -14,0 +14,0 @@ NodeJS.ReadableStream & NodeJS.WritableStream,

@@ -9,10 +9,7 @@ /**

encoding: Encoding,
options?: import('micromark-util-types').Options | undefined
options?: Options
) => string) &
((
value: Value,
options?: import('micromark-util-types').Options | undefined
) => string)
((value: Value, options?: Options) => string)
export type Options = import('micromark-util-types').Options
export type Value = import('micromark-util-types').Value
export type Encoding = import('micromark-util-types').Encoding

@@ -12,2 +12,3 @@ /**

export type CompileContext = import('micromark-util-types').CompileContext
export type Definition = import('micromark-util-types').Definition
export type Compile = import('micromark-util-types').Compile

@@ -26,5 +27,1 @@ export type Handle = import('micromark-util-types').Handle

}
export type Definition = {
destination?: string | undefined
title?: string | undefined
}

@@ -20,2 +20,3 @@ /**

* @typedef {import('micromark-util-types').CompileContext} CompileContext
* @typedef {import('micromark-util-types').Definition} Definition
* @typedef {import('micromark-util-types').Compile} Compile

@@ -35,6 +36,2 @@ * @typedef {import('micromark-util-types').Handle} Handle

* @property {string} [title]
*
* @typedef Definition
* @property {string} [destination]
* @property {string} [title]
*/

@@ -87,3 +84,3 @@ import {decodeNamedCharacterReference} from 'decode-named-character-reference'

*
* @type {string[][]}
* @type {Array<Array<string>>}
*/

@@ -96,3 +93,3 @@

*
* @type {Media[]}
* @type {Array<Media>}
*/

@@ -105,3 +102,3 @@

*
* @type {boolean[]}
* @type {Array<boolean>}
*/

@@ -216,3 +213,4 @@

const data = {
tightStack
tightStack,
definitions
}

@@ -256,3 +254,3 @@ /**

*
* @param {Event[]} events
* @param {Array<Event>} events
* @returns {string}

@@ -264,3 +262,3 @@ */

let start = 0
/** @type {number[]} */
/** @type {Array<number>} */

@@ -272,6 +270,6 @@ const listStack = [] // As definitions can come after references, we need to figure out the media

/** @type {Event[]} */
/** @type {Array<Event>} */
let head = []
/** @type {Event[]} */
/** @type {Array<Event>} */

@@ -347,3 +345,3 @@ let body = []

*
* @param {Event[]} slice
* @param {Array<Event>} slice
* @returns {void}

@@ -350,0 +348,0 @@ */

@@ -62,9 +62,9 @@ /**

const columnStart = {}
/** @type {Construct[]} */
/** @type {Array<Construct>} */
const resolveAllConstructs = []
/** @type {Chunk[]} */
/** @type {Array<Chunk>} */
let chunks = []
/** @type {Token[]} */
/** @type {Array<Token>} */

@@ -300,3 +300,3 @@ let stack = []

*
* @param {Construct|Construct[]|ConstructRecord} constructs
* @param {Construct|Array<Construct>|ConstructRecord} constructs
* @param {State} returnState

@@ -308,3 +308,3 @@ * @param {State} [bogusState]

function hook(constructs, returnState, bogusState) {
/** @type {Construct[]} */
/** @type {Array<Construct>} */
let listOfConstructs

@@ -353,3 +353,3 @@ /** @type {number} */

*
* @param {Construct[]} list
* @param {Array<Construct>} list
* @returns {State}

@@ -502,5 +502,5 @@ */

*
* @param {Chunk[]} chunks
* @param {Array<Chunk>} chunks
* @param {Pick<Token, 'start'|'end'>} token
* @returns {Chunk[]}
* @returns {Array<Chunk>}
*/

@@ -513,3 +513,3 @@

const endBufferIndex = token.end._bufferIndex
/** @type {Chunk[]} */
/** @type {Array<Chunk>} */

@@ -540,3 +540,3 @@ let view

*
* @param {Chunk[]} chunks
* @param {Array<Chunk>} chunks
* @param {boolean} [expandTabs=false]

@@ -548,3 +548,3 @@ * @returns {string}

let index = -1
/** @type {string[]} */
/** @type {Array<string>} */

@@ -551,0 +551,0 @@ const result = []

@@ -33,3 +33,3 @@ /**

const self = this
/** @type {StackItem[]} */
/** @type {Array<StackItem>} */

@@ -36,0 +36,0 @@ const stack = []

/**
* @param {Event[]} events
* @returns {Event[]}
* @param {Array<Event>} events
* @returns {Array<Event>}
*/
export function postprocess(
events: import('micromark-util-types').Event[]
): import('micromark-util-types').Event[]
events: Array<import('micromark-util-types').Event>
): Array<import('micromark-util-types').Event>
export type Event = import('micromark-util-types').Event

@@ -6,4 +6,4 @@ /**

/**
* @param {Event[]} events
* @returns {Event[]}
* @param {Array<Event>} events
* @returns {Array<Event>}
*/

@@ -10,0 +10,0 @@

@@ -13,2 +13,2 @@ /**

end?: boolean | undefined
) => Chunk[]
) => Array<Chunk>

@@ -13,3 +13,3 @@ /**

* @param {boolean} [end=false]
* @returns {Chunk[]}
* @returns {Array<Chunk>}
*/

@@ -34,3 +34,3 @@ const search = /[\0\t\n\r]/g

function preprocessor(value, encoding, end) {
/** @type {Chunk[]} */
/** @type {Array<Chunk>} */
const chunks = []

@@ -37,0 +37,0 @@ /** @type {RegExpMatchArray|null} */

{
"name": "micromark",
"version": "3.0.10",
"version": "3.1.0",
"description": "small commonmark compliant markdown parser with positional info and concrete tokens",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -89,3 +89,4 @@ <h1 align="center">

[npm][]:
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install with [npm][]:

@@ -96,2 +97,16 @@ ```sh

In Deno with [`esm.sh`][esmsh]:
```js
import {micromark} from 'https://esm.sh/micromark@3'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {micromark} from 'https://esm.sh/micromark@3?bundle'
</script>
```
## Use

@@ -211,3 +226,3 @@

Array of syntax extensions ([`Array.<SyntaxExtension>`][syntax-extension],
Array of syntax extensions ([`Array<SyntaxExtension>`][syntax-extension],
default: `[]`).

@@ -218,3 +233,3 @@ See [§ Extensions][extensions].

Array of HTML extensions ([`Array.<HtmlExtension>`][html-extension], default:
Array of HTML extensions ([`Array<HtmlExtension>`][html-extension], default:
`[]`).

@@ -1454,11 +1469,27 @@ See [§ Extensions][extensions].

<tr valign="middle">
<td width="20%" align="center" colspan="2">
<a href="https://www.gatsbyjs.org">Gatsby</a> 🥇<br><br>
<td width="20%" align="center" rowspan="2" colspan="2">
<a href="https://vercel.com">Vercel</a><br><br>
<a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" rowspan="2" colspan="2">
<a href="https://motif.land">Motif</a><br><br>
<a href="https://motif.land"><img src="https://avatars1.githubusercontent.com/u/74457950?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" rowspan="2" colspan="2">
<a href="https://www.hashicorp.com">HashiCorp</a><br><br>
<a href="https://www.hashicorp.com"><img src="https://avatars1.githubusercontent.com/u/761456?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" rowspan="2" colspan="2">
<a href="https://www.gitbook.com">GitBook</a><br><br>
<a href="https://www.gitbook.com"><img src="https://avatars1.githubusercontent.com/u/7111340?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" rowspan="2" colspan="2">
<a href="https://www.gatsbyjs.org">Gatsby</a><br><br>
<a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" colspan="2">
<a href="https://vercel.com">Vercel</a> 🥇<br><br>
<a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" colspan="2">
</tr>
<tr valign="middle">
</tr>
<tr valign="middle">
<td width="20%" align="center" rowspan="2" colspan="2">
<a href="https://www.netlify.com">Netlify</a><br><br>

@@ -1469,4 +1500,4 @@ <!--OC has a sharper image-->

<td width="10%" align="center">
<a href="https://www.holloway.com">Holloway</a><br><br>
<a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=128&v=4" width="64"></a>
<a href="https://www.coinbase.com">Coinbase</a><br><br>
<a href="https://www.coinbase.com"><img src="https://avatars1.githubusercontent.com/u/1885080?s=256&v=4" width="64"></a>
</td>

@@ -1478,12 +1509,19 @@ <td width="10%" align="center">

<td width="10%" align="center">
<a href="https://boosthub.io">Boost Hub</a><br><br>
<a href="https://boosthub.io"><img src="https://images.opencollective.com/boosthub/6318083/logo/128.png" width="64"></a>
</td>
<td width="10%" align="center">
<a href="https://expo.io">Expo</a><br><br>
<a href="https://expo.io"><img src="https://avatars1.githubusercontent.com/u/12504344?s=128&v=4" width="64"></a>
</td>
<td width="10%" align="center">
<a href="https://boostnote.io">Boost Note</a><br><br>
<a href="https://boostnote.io"><img src="https://images.opencollective.com/boosthub/6318083/logo/128.png" width="64"></a>
</td>
<td width="10%" align="center">
<a href="https://www.holloway.com">Holloway</a><br><br>
<a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=128&v=4" width="64"></a>
</td>
<td width="10%"></td>
<td width="10%"></td>
<td width="10%"></td>
</tr>
<tr valign="middle">
<td width="100%" align="center" colspan="10">
<td width="100%" align="center" colspan="8">
<br>

@@ -1584,2 +1622,6 @@ <a href="https://opencollective.com/unified"><strong>You?</strong></a>

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[esmsh]: https://esm.sh
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

@@ -1586,0 +1628,0 @@

@@ -11,3 +11,3 @@ /**

export type Encoding = import('micromark-util-types').Encoding
export type Callback = (error?: Error | undefined) => void
export type Callback = (error?: Error) => void
export type MinimalDuplex = Omit<

@@ -14,0 +14,0 @@ NodeJS.ReadableStream & NodeJS.WritableStream,

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