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

remark-react

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-react - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

11

history.md

@@ -0,1 +1,12 @@

<a name="4.0.2"></a>
## [4.0.2](https://github.com/mapbox/remark-react/compare/4.0.1...v4.0.2) (2018-04-26)
### Bug Fixes
* Update hast-to-hyperscript and mdast-util-to-hast ([a8231c0](https://github.com/mapbox/remark-react/commit/a8231c0))
* Use hast-util-table-cell-style to adjust align properties ([d141733](https://github.com/mapbox/remark-react/commit/d141733))
<a name="4.0.1"></a>

@@ -2,0 +13,0 @@ ## [4.0.1](https://github.com/mapbox/remark-react/compare/v4.0.0...v4.0.1) (2017-05-22)

27

index.js

@@ -8,3 +8,3 @@ 'use strict';

var toH = require('hast-to-hyperscript');
var xtend = require('xtend');
var tableCellStyle = require('@mapbox/hast-util-table-cell-style');

@@ -41,6 +41,3 @@ var globalCreateElement;

var toHastOptions = settings.toHast || {};
var components = xtend({
td: createTableCellComponent('td'),
th: createTableCellComponent('th')
}, settings.remarkReactComponents);
var components = settings.remarkReactComponents || {};

@@ -93,22 +90,6 @@ this.Compiler = compile;

hast = tableCellStyle(hast);
return toH(h, hast, settings.prefix);
}
/**
* Create a functional React component for a cell.
* We need this because GFM uses `align`, whereas React
* forbids that and wants `style.textAlign` instead.
*/
function createTableCellComponent(tagName) {
return TableCell;
function TableCell(props) {
var fixedProps = xtend(props, {
children: undefined,
style: {textAlign: props.align}
});
delete fixedProps.align;
return createElement(tagName, fixedProps, props.children);
}
}
}
{
"name": "remark-react",
"description": "Compile Markdown to React with remark",
"version": "4.0.1",
"version": "4.0.2",
"author": {

@@ -19,7 +19,6 @@ "name": "Titus Wormer",

"dependencies": {
"hast-to-hyperscript": "^3.0.0",
"@mapbox/hast-util-table-cell-style": "^0.1.1",
"hast-to-hyperscript": "^4.0.0",
"hast-util-sanitize": "^1.0.0",
"mdast-util-to-hast": "^2.0.0",
"standard-changelog": "^0.0.1",
"xtend": "^4.0.1"
"mdast-util-to-hast": "^3.0.0"
},

@@ -36,2 +35,3 @@ "devDependencies": {

"remark-toc": "^4.0.0",
"standard-changelog": "^0.0.1",
"vfile": "^2.0.0",

@@ -38,0 +38,0 @@ "xo": "^0.17.1"

@@ -82,4 +82,10 @@ # remark-react

The default schema, if none or `true` is passed, adheres to GitHub’s
sanitation rules. If `false` is passed, it does not sanitize input.
sanitation rules.
**This means that non-standard HAST nodes and many
HTML elements are *by default* santized out.** If you want to be more
permissive, you should provide a value for `sanitize`.
If `false` is passed, it does not sanitize input.
* `prefix` (`string`, default: `h-`)

@@ -104,8 +110,2 @@ — React key.

Note: as GFM uses `align` on `td` and `th`, and React doesn’t like that,
we [overwrite](https://github.com/mapbox/remark-react/blob/master/index.js#L94)
them through `remarkReactComponents` to use `style.textAlign` instead.
This means that if you set `td` or `td`, you’ll need to handle `align`
yourself.
* `toHast` (`object`, default: `{}`)

@@ -112,0 +112,0 @@ — Provides options for transforming MDAST document to 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