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

remarkable

Package Overview
Dependencies
Maintainers
8
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remarkable - npm Package Compare versions

Comparing version 1.7.4 to 2.0.0

dist/cjs/cli.js

77

bin/remarkable.js
#!/usr/bin/env node
/*eslint no-console:0*/
'use strict';
var fs = require('fs');
var argparse = require('argparse');
var Remarkable = require('..');
////////////////////////////////////////////////////////////////////////////////
var cli = new argparse.ArgumentParser({
prog: 'remarkable',
version: require('../package.json').version,
addHelp: true
});
cli.addArgument([ 'file' ], {
help: 'File to read',
nargs: '?',
defaultValue: '-'
});
var options = cli.parseArgs();
function readFile(filename, encoding, callback) {
if (options.file === '-') {
var chunks = [];
// read from stdin
process.stdin.on('data', function(chunk) {
chunks.push(chunk);
});
process.stdin.on('end', function() {
return callback(null, Buffer.concat(chunks).toString(encoding));
});
} else {
fs.readFile(filename, encoding, callback);
}
}
////////////////////////////////////////////////////////////////////////////////
readFile(options.file, 'utf8', function (err, input) {
var output, md;
if (err) {
if (err.code === 'ENOENT') {
console.error('File not found: ' + options.file);
process.exit(2);
}
console.error(err.stack || err.message || String(err));
process.exit(1);
}
md = new Remarkable('full', {
html: true,
xhtmlOut: true,
typographer: true,
linkify: true
});
try {
output = md.render(input);
} catch (e) {
console.error(e.stack || e.message || String(e));
process.exit(1);
}
process.stdout.write(output);
process.exit(0);
});
require('../dist/cjs/cli.js');

@@ -0,1 +1,18 @@

2.0.0 / 2019-08-07
- bundle umd with rollup (#346)
- remove bower support (#347)
- decouple linkify in separate plugin (#351)
- convert code to esm and distribute as cjs and esm bundles (#352)
- upgrade autolinker (#356)
- provide smaller browser version of entities (#359)
- use named exports for public api (#354)
1.7.4 / 2019-07-30
------------------
- upgrade argparse (https://github.com/jonschlinkert/remarkable/pull/349)
- prevent a ReDoS vulnerability (#335)
- disallow ascii control characters in URLs (#334)
1.7.0 / 2016-09-27

@@ -2,0 +19,0 @@ ------------------

{
"name": "remarkable",
"description": "Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.",
"version": "1.7.4",
"version": "2.0.0",
"homepage": "https://github.com/jonschlinkert/remarkable",
"maintainers": [
"doowb <brian.woodward@sellside.com>",
"jonschlinkert <github@sellside.com>"
"jonschlinkert <github@sellside.com>",
"Bogdan Chadkin <trysound@yandex.ru>"
],

@@ -41,3 +42,3 @@ "contributors": [

],
"repository": "jonschlinkert/remarkable",
"repository": "https://github.com/jonschlinkert/remarkable",
"bugs": {

@@ -49,21 +50,35 @@ "url": "https://github.com/jonschlinkert/remarkable/issues"

"bin",
"linkify",
"dist",
"index.js",
"lib"
"index.js"
],
"main": "index.js",
"bin": "./bin/remarkable.js",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"browser": {
"./dist/cjs/index.js": "./dist/cjs/index.browser.js",
"./dist/esm/index.js": "./dist/esm/index.browser.js"
},
"engines": {
"node": ">= 0.10.0"
"node": ">= 6.0.0"
},
"scripts": {
"test": "make test",
"test-ci": "nyc mocha -R spec --bail",
"build": "rm -rf dist && yarn rollup -c",
"lint": "eslint .",
"test:browser": "yarn build && node -r esm ./test/test-browser.js && serve .",
"test:spec": "./support/specsplit.js test/fixtures/commonmark/spec.txt",
"test:mocha": "mocha -r esm -R spec",
"test:ci": "nyc mocha -r esm -R spec --bail",
"test": "yarn test:mocha && yarn test:spec",
"coverage": "yarn add coveralls@2 && nyc report --reporter=text-lcov | coveralls",
"build": "make browserify",
"prepublishOnly": "make browserify"
"prepublishOnly": "yarn build"
},
"nyc": {
"exclude": [
"dist"
]
},
"dependencies": {
"argparse": "^1.0.10",
"autolinker": "~0.28.0"
"autolinker": "^3.11.0"
},

@@ -73,4 +88,6 @@ "devDependencies": {

"benchmark": "^1.0.0",
"browserify": "^16.3.0",
"commonmark": "0.12.0",
"eslint": "^6.1.0",
"eslint-plugin-es5": "^1.4.1",
"esm": "^3.2.25",
"gulp-format-md": "^0.1.10",

@@ -80,3 +97,8 @@ "highlight.js": "^9.7.0",

"mocha": "^6.1.4",
"nyc": "^14.1.1"
"nyc": "^14.1.1",
"rollup": "^1.16.7",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.1.1",
"serve": "^11.1.0"
},

@@ -83,0 +105,0 @@ "keywords": [

@@ -27,8 +27,2 @@ # remarkable

**bower:**
```bash
bower install remarkable --save
```
**browser (CDN):**

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

```js
var Remarkable = require('remarkable');
import { Remarkable } from 'remarkable';
var md = new Remarkable();

@@ -51,2 +45,13 @@

or with commonjs
```js
const { Remarkable } = require('remarkable');
var md = new Remarkable();
console.log(md.render('# Remarkable rulezz!'));
// => <h1>Remarkable rulezz!</h1>
```
If installed globally with `npm`:

@@ -91,3 +96,2 @@

langPrefix: 'language-', // CSS language prefix for fenced blocks
linkify: false, // Autoconvert URL-like text to links

@@ -115,3 +119,4 @@ // Enable some language-neutral replacement + quotes beautification

```js
var Remarkable = require('remarkable');
import { Remarkable } from 'remarkable';
var md = new Remarkable();

@@ -141,3 +146,3 @@

```js
var Remarkable = require('remarkable');
import { Remarkable } from 'remarkable';
var md = new Remarkable('commonmark');

@@ -151,3 +156,3 @@ ```

```js
var Remarkable = require('remarkable');
import { Remarkable } from 'remarkable';
var md = new Remarkable('full');

@@ -158,3 +163,2 @@

html: true,
linkify: true,
typographer: true

@@ -170,4 +174,4 @@ });

```js
var Remarkable = require('remarkable');
var hljs = require('highlight.js') // https://highlightjs.org/
import { Remarkable } from 'remarkable';
import hljs from 'highlight.js' // https://highlightjs.org/

@@ -223,3 +227,2 @@ // Actual default values

html: true,
linkify: true,
typographer: true,

@@ -255,3 +258,3 @@ });

```js
var Remarkable = require('remarkable');
import { Remarkable } from 'remarkable';
var md = new Remarkable({

@@ -299,2 +302,22 @@ typographer: true,

### linkify plugin
Autoconvert URL-like text to links
```js
import { Remarkable } from 'remarkable';
import { linkify } from 'remarkable/linkify';
var md = new Remarkable().use(linkify);
```
### UMD
UMD bundle provides linkify out of the box
```js
const { Remarkable, linkify, utils } = window.remarkable;
```
## References / Thanks

@@ -301,0 +324,0 @@

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