@nteract/markdown
Advanced tools
Comparing version 2.1.4 to 3.0.0
// @flow | ||
import * as React from "react"; | ||
import Markdown from "../src"; | ||
import renderer from "react-test-renderer"; | ||
import { mount } from "enzyme"; | ||
import toJson from "enzyme-to-json"; | ||
import Enzyme, { shallow, render, mount } from "enzyme"; | ||
import Adapter from "enzyme-adapter-react-16"; | ||
import Markdown from "../src"; | ||
@@ -12,0 +9,0 @@ const cases = [ |
@@ -1,2 +0,1 @@ | ||
import math from "../src/remark-math"; | ||
import unified from "unified"; | ||
@@ -7,2 +6,4 @@ import parse from "remark-parse"; | ||
import math from "../src/remark-math"; | ||
function remark() { | ||
@@ -9,0 +10,0 @@ return unified() |
@@ -20,4 +20,2 @@ "use strict"; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var math = function math(props) { | ||
@@ -33,3 +31,3 @@ return _react.default.createElement(_mathjax.default.Node, null, props.value); | ||
var MarkdownRender = function MarkdownRender(props, context) { | ||
var MarkdownRender = function MarkdownRender(props) { | ||
var newProps = (0, _objectSpread2.default)({}, props, { | ||
@@ -42,20 +40,7 @@ escapeHtml: false, | ||
}) | ||
}); // Render a Context if one was not passed as a parent | ||
if (!context.MathJaxContext) { | ||
return _react.default.createElement(_mathjax.default.Context, { | ||
input: "tex" | ||
}, _react.default.createElement(_reactMarkdown.default, newProps)); | ||
} | ||
}); | ||
return _react.default.createElement(_reactMarkdown.default, newProps); | ||
}; | ||
MarkdownRender.contextTypes = { | ||
// Opt in to updates to the MathJax object even though | ||
// Not explicitly used | ||
MathJax: _propTypes.default.object, | ||
MathJaxContext: _propTypes.default.bool | ||
}; | ||
var _default = MarkdownRender; | ||
exports.default = _default; |
@@ -18,3 +18,3 @@ "use strict"; | ||
var MIN_FENCE_COUNT = 2; | ||
var CODE_INDENT_COUNT = 4; | ||
var CODE_INDENT_COUNT = 4; // eslint-disable-next-line no-unused-vars | ||
@@ -21,0 +21,0 @@ function blockPlugin(opts) { |
@@ -15,3 +15,3 @@ "use strict"; | ||
var INLINE_MATH = /^\$((?:\\\$|[^$])+)\$/; | ||
var INLINE_MATH_DOUBLE = /^\$\$((?:\\\$|[^$])+)\$\$/; | ||
var INLINE_MATH_DOUBLE = /^\$\$((?:\\\$|[^$])+)\$\$/; // eslint-disable-next-line no-unused-vars | ||
@@ -18,0 +18,0 @@ function inlinePlugin(opts) { |
{ | ||
"name": "@nteract/markdown", | ||
"version": "2.1.4", | ||
"version": "3.0.0", | ||
"description": "Markdown/MathJax renderer for nteract", | ||
@@ -29,14 +29,7 @@ "main": "lib/index.js", | ||
"@babel/runtime-corejs2": "^7.0.0", | ||
"@nteract/mathjax": "^2.1.4", | ||
"@nteract/mathjax": "^3.0.0", | ||
"babel-runtime": "^6.26.0", | ||
"prop-types": "^15.6.1", | ||
"react-markdown": "^3.1.4" | ||
"react-markdown": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"remark-parse": "^5.0.0", | ||
"remark-stringify": "^5.0.0", | ||
"unified": "^7.0.0", | ||
"unist-builder": "^1.0.2" | ||
}, | ||
"gitHead": "b26ca67b6930b5aa2dc23d498e48b30374655471" | ||
"gitHead": "3f9fa9a396cc966327b9d084239d9e024e78664b" | ||
} |
@@ -5,6 +5,5 @@ // @flow | ||
import MathJax from "@nteract/mathjax"; | ||
import RemarkMathPlugin from "./remark-math"; | ||
import PropTypes from "prop-types"; | ||
const math = (props: { value: string }) => ( | ||
@@ -18,6 +17,3 @@ <MathJax.Node>{props.value}</MathJax.Node> | ||
const MarkdownRender = ( | ||
props: ReactMarkdown.ReactMarkdownProps, | ||
context: { MathJaxContext?: boolean } | ||
) => { | ||
const MarkdownRender = (props: ReactMarkdown.ReactMarkdownProps) => { | ||
const newProps = { | ||
@@ -35,21 +31,5 @@ // https://github.com/rexxars/react-markdown#options | ||
// Render a Context if one was not passed as a parent | ||
if (!context.MathJaxContext) { | ||
return ( | ||
<MathJax.Context input="tex"> | ||
<ReactMarkdown {...newProps} /> | ||
</MathJax.Context> | ||
); | ||
} | ||
return <ReactMarkdown {...newProps} />; | ||
}; | ||
MarkdownRender.contextTypes = { | ||
// Opt in to updates to the MathJax object even though | ||
// Not explicitly used | ||
MathJax: PropTypes.object, | ||
MathJaxContext: PropTypes.bool | ||
}; | ||
export default MarkdownRender; |
@@ -12,2 +12,3 @@ // @flow | ||
// eslint-disable-next-line no-unused-vars | ||
export function blockPlugin(opts: Object) { | ||
@@ -14,0 +15,0 @@ function blockTokenizer(eat, value, silent) { |
@@ -11,2 +11,3 @@ // @flow | ||
// eslint-disable-next-line no-unused-vars | ||
export function inlinePlugin(opts: Object) { | ||
@@ -13,0 +14,0 @@ function inlineTokenizer(eat, value, silent) { |
Sorry, the diff of this file is not supported yet
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
38004
4
0
935
+ Added@nteract/mathjax@3.0.1(transitive)
+ Addeddom-serializer@2.0.0(transitive)
+ Addeddomelementtype@2.3.0(transitive)
+ Addeddomhandler@5.0.3(transitive)
+ Addeddomutils@3.1.0(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedhtml-to-react@1.7.0(transitive)
+ Addedhtmlparser2@9.1.0(transitive)
+ Addedlodash.camelcase@4.3.0(transitive)
+ Addedreact-markdown@4.3.1(transitive)
- Removedprop-types@^15.6.1
- Removed@nteract/mathjax@2.2.0(transitive)
- Removedreact-markdown@3.6.0(transitive)
Updated@nteract/mathjax@^3.0.0
Updatedreact-markdown@^4.0.0