Socket
Socket
Sign inDemoInstall

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.0-alpha.3 to 3.0.0-beta.1

12

dev/lib/compile.d.ts

@@ -8,14 +8,2 @@ /**

): Compile
/**
* Turn the number (in string form as either hexa- or plain decimal) coming from
* a numeric character reference into a character.
*
* @param {string} value
* @param {number} base
* @returns {string}
*/
export function parseNumericCharacterReference(
value: string,
base: number
): string
export type Event = import('micromark-util-types').Event

@@ -22,0 +10,0 @@ export type CompileOptions = import('micromark-util-types').CompileOptions

37

dev/lib/compile.js

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

import {push} from 'micromark-util-chunked'
import {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'
import {encode as _encode} from 'micromark-util-encode'

@@ -51,3 +52,2 @@ import {normalizeIdentifier} from 'micromark-util-normalize-identifier'

import {types} from 'micromark-util-symbol/types.js'
import {values} from 'micromark-util-symbol/values.js'

@@ -956,3 +956,3 @@ const hasOwnProperty = {}.hasOwnProperty

value = getData('characterReferenceType')
? parseNumericCharacterReference(
? decodeNumericCharacterReference(
value,

@@ -993,34 +993,1 @@ getData('characterReferenceType') ===

}
/**
* Turn the number (in string form as either hexa- or plain decimal) coming from
* a numeric character reference into a character.
*
* @param {string} value
* @param {number} base
* @returns {string}
*/
export function parseNumericCharacterReference(value, base) {
const code = Number.parseInt(value, base)
if (
// C0 except for HT, LF, FF, CR, space
code < codes.ht ||
code === codes.vt ||
(code > codes.cr && code < codes.space) ||
// Control character (DEL) of the basic block and C1 controls.
(code > codes.tilde && code < 160) ||
// Lone high surrogates and low surrogates.
(code > 55295 && code < 57344) ||
// Noncharacters.
(code > 64975 && code < 65008) ||
(code & 65535) === 65535 ||
(code & 65535) === 65534 ||
// Out of range
code > 1114111
) {
return values.replacementCharacter
}
return String.fromCharCode(code)
}

@@ -8,14 +8,2 @@ /**

): Compile
/**
* Turn the number (in string form as either hexa- or plain decimal) coming from
* a numeric character reference into a character.
*
* @param {string} value
* @param {number} base
* @returns {string}
*/
export function parseNumericCharacterReference(
value: string,
base: number
): string
export type Event = import('micromark-util-types').Event

@@ -22,0 +10,0 @@ export type CompileOptions = import('micromark-util-types').CompileOptions

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

import {push} from 'micromark-util-chunked'
import {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'
import {encode as _encode} from 'micromark-util-encode'

@@ -936,3 +937,3 @@ import {normalizeIdentifier} from 'micromark-util-normalize-identifier'

value = getData('characterReferenceType')
? parseNumericCharacterReference(
? decodeNumericCharacterReference(
value,

@@ -972,30 +973,1 @@ getData('characterReferenceType') ===

}
/**
* Turn the number (in string form as either hexa- or plain decimal) coming from
* a numeric character reference into a character.
*
* @param {string} value
* @param {number} base
* @returns {string}
*/
export function parseNumericCharacterReference(value, base) {
const code = Number.parseInt(value, base)
if (
// C0 except for HT, LF, FF, CR, space
code < 9 ||
code === 11 ||
(code > 13 && code < 32) || // Control character (DEL) of the basic block and C1 controls.
(code > 126 && code < 160) || // Lone high surrogates and low surrogates.
(code > 55295 && code < 57344) || // Noncharacters.
(code > 64975 && code < 65008) ||
(code & 65535) === 65535 ||
(code & 65535) === 65534 || // Out of range
code > 1114111
) {
return '\uFFFD'
}
return String.fromCharCode(code)
}

27

package.json
{
"name": "micromark",
"version": "3.0.0-alpha.3",
"version": "3.0.0-beta.1",
"description": "small commonmark compliant markdown parser with positional info and concrete tokens",

@@ -101,14 +101,15 @@ "license": "MIT",

"debug": "^4.0.0",
"micromark-core-commonmark": "1.0.0-alpha.3",
"micromark-factory-space": "1.0.0-alpha.3",
"micromark-util-character": "1.0.0-alpha.3",
"micromark-util-chunked": "1.0.0-alpha.3",
"micromark-util-combine-extensions": "1.0.0-alpha.3",
"micromark-util-encode": "1.0.0-alpha.3",
"micromark-util-normalize-identifier": "1.0.0-alpha.3",
"micromark-util-resolve-all": "1.0.0-alpha.3",
"micromark-util-sanitize-uri": "1.0.0-alpha.3",
"micromark-util-subtokenize": "1.0.0-alpha.3",
"micromark-util-symbol": "1.0.0-alpha.3",
"micromark-util-types": "1.0.0-alpha.3",
"micromark-core-commonmark": "1.0.0-beta.1",
"micromark-factory-space": "1.0.0-beta.1",
"micromark-util-character": "1.0.0-beta.1",
"micromark-util-chunked": "1.0.0-beta.1",
"micromark-util-combine-extensions": "1.0.0-beta.1",
"micromark-util-decode-numeric-character-reference": "1.0.0-beta.1",
"micromark-util-encode": "1.0.0-beta.1",
"micromark-util-normalize-identifier": "1.0.0-beta.1",
"micromark-util-resolve-all": "1.0.0-beta.1",
"micromark-util-sanitize-uri": "1.0.0-beta.1",
"micromark-util-subtokenize": "1.0.0-beta.1",
"micromark-util-symbol": "1.0.0-beta.1",
"micromark-util-types": "1.0.0-beta.1",
"parse-entities": "^3.0.0"

@@ -115,0 +116,0 @@ },

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