Socket
Socket
Sign inDemoInstall

markdown-to-jsx

Package Overview
Dependencies
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-to-jsx - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

28

index.es5.js

@@ -419,19 +419,17 @@ 'use strict';

if (ast.type === 'table') {
(function () {
var tbody = { type: 'tbody', children: [] };
var tbody = { type: 'tbody', children: [] };
ast.children = ast.children.reduce(function (children, child, index) {
if (index === 0) {
/* manually marking the first row as tableHeader since that was removed in remark@4.x; it's important semantically. */
child.type = 'tableHeader';
children.unshift(seekCellsAndAlignThemIfNecessary(child, ast.align));
} else if (child.type === 'tableRow') {
tbody.children.push(seekCellsAndAlignThemIfNecessary(child, ast.align));
} else if (child.type === 'tableFooter') {
children.push(seekCellsAndAlignThemIfNecessary(child, ast.align));
}
ast.children = ast.children.reduce(function (children, child, index) {
if (index === 0) {
/* manually marking the first row as tableHeader since that was removed in remark@4.x; it's important semantically. */
child.type = 'tableHeader';
children.unshift(seekCellsAndAlignThemIfNecessary(child, ast.align));
} else if (child.type === 'tableRow') {
tbody.children.push(seekCellsAndAlignThemIfNecessary(child, ast.align));
} else if (child.type === 'tableFooter') {
children.push(seekCellsAndAlignThemIfNecessary(child, ast.align));
}
return children;
}, [tbody]);
})();
return children;
}, [tbody]);
} /* React yells if things aren't in the proper structure, so need to

@@ -438,0 +436,0 @@ delve into the immediate children and wrap tablerow(s) in a tbody */

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "5.0.0",
"version": "5.0.1",
"engines": {

@@ -31,3 +31,3 @@ "node": ">= 4"

"babelify": "^7.3.0",
"browserify": "^13.1.0",
"browserify": "^14.1.0",
"budo": "^9.2.0",

@@ -34,0 +34,0 @@ "bundle-collapser": "^1.2.1",

# markdown to jsx compiler
![build status](https://api.travis-ci.org/yaycmyk/markdown-to-jsx.svg) [![codecov](https://codecov.io/gh/yaycmyk/markdown-to-jsx/branch/master/graph/badge.svg)](https://codecov.io/gh/yaycmyk/markdown-to-jsx) ![downloads](https://img.shields.io/npm/dm/markdown-to-jsx.svg)
[![npm version](https://badge.fury.io/js/markdown-to-jsx.svg)](https://badge.fury.io/js/markdown-to-jsx) ![build status](https://api.travis-ci.org/yaycmyk/markdown-to-jsx.svg) [![codecov](https://codecov.io/gh/yaycmyk/markdown-to-jsx/branch/master/graph/badge.svg)](https://codecov.io/gh/yaycmyk/markdown-to-jsx) ![downloads](https://img.shields.io/npm/dm/markdown-to-jsx.svg)

@@ -21,3 +21,3 @@ Enables the safe parsing of markdown into proper React JSX objects, so you don't need to use a pattern like `dangerouslySetInnerHTML` and potentially open your application up to security issues.

ES6-style usage:
ES6-style usage\*:

@@ -29,5 +29,9 @@ ```jsx

const markdown = `
# Hello world!
`.trim();
render((
<Markdown>
# Hello world!
{markdown}
</Markdown>

@@ -43,2 +47,4 @@ ), document.body);

\* __NOTE: JSX does not natively preserve newlines in multiline text, which is why the example above is inside an ES6 template literal. In general, writing markdown directly in JSX is discouraged and it's a better idea to keep your content in separate .md files and require them, perhaps using webpack's [raw-loader](https://github.com/webpack-contrib/raw-loader).__
Override a particular HTML tag's output:

@@ -45,0 +51,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