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

commonmark

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commonmark - npm Package Compare versions

Comparing version 0.29.2 to 0.29.3

dist/package.json

34

changelog.txt

@@ -0,1 +1,35 @@

[0.29.3]
* Fix some rough edges around ES modules (Kyle E. Mitchell)
(#195, #201, #203):
+ Set module types via package.json files in subdirectories.
A number of JavaScript files were rewritten as ES
Modules, but their extensions remained `.js`. That
extension is ambiguous to newer version of the Node.js
runtime, which can load both CommonJS modules and ES
Modules. To fix this, we add `package.json` files with
`type` properties to the various subdirectories. Setting
`type` to `"module"` tells Node.js to interpret `.js`
files in that directory and below as ES Modules.
Otherwise, Node.js falls back on the `package.json` at
root, which currently sets `type` to `"commonjs"`.
+ Make benchmark and test use commonjs again.
+ bin: remove use of ESM and use `require('../')`.
Node.js version 14, which supports ES Modules without any flag or the
`esm` package, is currently in long-term support. But a great many
folks still run older version of Node.js that either don't support ES
Modules at all or hide that support behind a feature flag.
+ Import specific functions from `entities` package.
+ Update "Basic Usage" comment in `lib/index.js`.
* Remove package-lock.json (Kyle E. Mitchell).
* Fix 'make test' target so that dist is built.
* `reHtmlTag`: don't use case-insensitive matching (#193).
The spec specifies uppercase for declarations and CDATA.
* Handle piped input from stdin in windows. Use file descriptor 0
instead of '/dev/stdin'. Note that this allows piping but doesn't
handle the case where users run `bin/commonmark` and enter input
directly. See #198 for some relevant discussion.
* Configure GitHub Actions to test on Node.js 14 and 15 (Kyle E. Mitchell).
* Allow EOL in processing instructions (#196).
[0.29.2]

@@ -2,0 +36,0 @@

8

lib/common.js
"use strict";
import encode from "mdurl/encode.js";
import * as entities from "entities";
import { decodeHTML } from "entities";

@@ -28,3 +28,3 @@ var C_BACKSLASH = 92;

var HTMLCOMMENT = "<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->";
var PROCESSINGINSTRUCTION = "[<][?].*?[?][>]";
var PROCESSINGINSTRUCTION = "[<][?][\\s\\S]*?[?][>]";
var DECLARATION = "<![A-Z]+" + "\\s+[^>]*>";

@@ -46,3 +46,3 @@ var CDATA = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>";

")";
var reHtmlTag = new RegExp("^" + HTMLTAG, "i");
var reHtmlTag = new RegExp("^" + HTMLTAG);

@@ -63,3 +63,3 @@ var reBackslashOrAmp = /[\\&]/;

} else {
return entities.decodeHTML(s);
return decodeHTML(s);
}

@@ -66,0 +66,0 @@ };

@@ -9,5 +9,5 @@ "use strict";

//
// var commonmark = require('commonmark');
// var parser = new commonmark.Parser();
// var renderer = new commonmark.HtmlRenderer();
// import { Parser, HtmlRenderer } from 'commonmark';
// var parser = new Parser();
// var renderer = new HtmlRenderer();
// console.log(renderer.render(parser.parse('Hello *world*')));

@@ -14,0 +14,0 @@

@@ -6,3 +6,3 @@ "use strict";

import fromCodePoint from "./from-code-point.js";
import * as entities from "entities";
import { decodeHTML } from "entities";
import "string.prototype.repeat"; // Polyfill for String.prototype.repeat

@@ -760,3 +760,3 @@

if ((m = this.match(reEntityHere))) {
block.appendChild(text(entities.decodeHTML(m)));
block.appendChild(text(decodeHTML(m)));
return true;

@@ -763,0 +763,0 @@ } else {

{
"name": "commonmark",
"description": "a strongly specified, highly compatible variant of Markdown",
"version": "0.29.2",
"version": "0.29.3",
"homepage": "https://commonmark.org",

@@ -33,3 +33,3 @@ "keywords": [

"lint": "eslint .",
"test": "node -r esm ./test/test"
"test": "node ./test/test"
},

@@ -39,4 +39,4 @@ "dependencies": {

"mdurl": "~1.0.1",
"string.prototype.repeat": "^0.2.0",
"minimist": ">=1.2.2"
"minimist": ">=1.2.2",
"string.prototype.repeat": "^0.2.0"
},

@@ -58,3 +58,2 @@ "directories": {

"eslint": "^7.4.0",
"esm": "^3.2.25",
"http-server": "^0.12.3",

@@ -61,0 +60,0 @@ "lodash": "^4.17.19",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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