remark-react
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
4
0
12774
12
77
+ Added@mapbox/hast-util-table-cell-style@0.1.3(transitive)
+ Addedhast-to-hyperscript@4.0.0(transitive)
+ Addedmdast-util-to-hast@3.0.4(transitive)
- Removedstandard-changelog@^0.0.1
- Removedxtend@^4.0.1
- RemovedJSONStream@1.3.5(transitive)
- Removedadd-stream@1.0.0(transitive)
- Removedarray-find-index@1.0.2(transitive)
- Removedarray-ify@1.0.0(transitive)
- Removedarrify@1.0.1(transitive)
- Removedcamelcase@2.1.14.1.0(transitive)
- Removedcamelcase-keys@2.1.04.2.0(transitive)
- Removedcompare-func@1.3.4(transitive)
- Removedconventional-changelog-angular@0.1.0(transitive)
- Removedconventional-changelog-core@0.0.2(transitive)
- Removedconventional-changelog-writer@0.4.2(transitive)
- Removedconventional-commits-filter@0.1.1(transitive)
- Removedconventional-commits-parser@0.1.2(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcurrently-unhandled@0.4.1(transitive)
- Removeddargs@4.1.0(transitive)
- Removeddateformat@1.0.12(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddecamelize-keys@1.1.1(transitive)
- Removeddot-prop@3.0.0(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedfind-up@1.1.22.1.0(transitive)
- Removedget-pkg-repo@0.1.0(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedgit-raw-commits@0.1.2(transitive)
- Removedgit-semver-tags@1.3.6(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhandlebars@4.7.8(transitive)
- Removedhast-to-hyperscript@3.1.0(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedindent-string@2.1.03.2.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-obj@1.0.1(transitive)
- Removedis-plain-obj@1.1.0(transitive)
- Removedis-subset@0.1.1(transitive)
- Removedis-text-path@1.0.1(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedisarray@1.0.0(transitive)
- Removedjson-parse-better-errors@1.0.2(transitive)
- Removedjsonparse@1.3.1(transitive)
- Removedload-json-file@1.1.04.0.0(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedlodash@3.10.14.17.21(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._basetostring@3.0.1(transitive)
- Removedlodash._basevalues@3.0.0(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash._reinterpolate@3.0.0(transitive)
- Removedlodash._root@3.0.1(transitive)
- Removedlodash.escape@3.2.0(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.restparam@3.6.1(transitive)
- Removedlodash.template@3.6.2(transitive)
- Removedlodash.templatesettings@3.1.1(transitive)
- Removedloud-rejection@1.6.0(transitive)
- Removedmap-obj@1.0.12.0.0(transitive)
- Removedmdast-util-to-hast@2.5.0(transitive)
- Removedmeow@3.7.04.0.1(transitive)
- Removedminimist@1.2.8(transitive)
- Removedminimist-options@3.0.2(transitive)
- Removedmodify-values@1.0.1(transitive)
- Removedneo-async@2.6.2(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-try@1.0.0(transitive)
- Removedparse-json@2.2.04.0.0(transitive)
- Removedpath-exists@2.1.03.0.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-type@1.1.03.0.0(transitive)
- Removedpify@2.3.03.0.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedq@1.5.1(transitive)
- Removedquick-lru@1.1.0(transitive)
- Removedread-pkg@1.1.03.0.0(transitive)
- Removedread-pkg-up@1.0.13.0.0(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedredent@1.0.02.0.0(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedresolve@1.22.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedsplit@1.0.1(transitive)
- Removedsplit2@1.1.1(transitive)
- Removedstandard-changelog@0.0.1(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-bom@2.0.03.0.0(transitive)
- Removedstrip-indent@1.0.12.0.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedtempfile@1.1.1(transitive)
- Removedtext-extensions@1.9.0(transitive)
- Removedthrough@2.3.8(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedtrim-newlines@1.0.02.0.0(transitive)
- Removedtrim-off-newlines@1.0.3(transitive)
- Removeduglify-js@3.19.3(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removeduuid@2.0.3(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedwordwrap@1.0.0(transitive)
Updatedhast-to-hyperscript@^4.0.0
Updatedmdast-util-to-hast@^3.0.0