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

babel-plugin-markdown-in-jsx

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-markdown-in-jsx - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

0

component/index.d.ts

@@ -0,0 +0,0 @@ import * as React from "react";

module.exports = props => props.children;
module.exports.default = props => props.children;

@@ -0,0 +0,0 @@ import * as React from "react";

@@ -0,0 +0,0 @@ const React = require('react');

@@ -0,0 +0,0 @@ /** @preserve

10

index.js

@@ -177,4 +177,4 @@ const _ = require('lodash');

}
const ProgramPath = jsxIdentifierPath.findParent(babelTypes.isProgram);
if (state.commonjs) {
const ProgramPath = jsxIdentifierPath.findParent(babelTypes.isProgram);
ProgramPath.unshiftContainer('body',

@@ -189,2 +189,10 @@ babelTypes.variableDeclaration('var', [

state.proxyContextName = declaratorName;
} else {
ProgramPath.unshiftContainer('body',
babelTypes.importDeclaration(
[babelTypes.importNamespaceSpecifier(babelTypes.identifier(declaratorName))],
babelTypes.stringLiteral(join(options.package, 'component/proxy'))
)
);
state.proxyContextName = declaratorName;
}

@@ -191,0 +199,0 @@ }

2

package.json
{
"name": "babel-plugin-markdown-in-jsx",
"version": "1.0.1",
"version": "1.0.2",
"description": "Transform Markdown inside JSX to DOM elements at compile time.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -91,3 +91,3 @@ # babel-plugin-markdown-in-jsx

``` html
``` js
<Markdown>

@@ -140,5 +140,5 @@ 123

比如要替换文中所有的 `<img />` 和 `<h1 />`
比如要替换文中所有的 `<img />` 和 `<h1 />`
``` html
``` js
<Proxy.Provider

@@ -154,5 +154,5 @@ value={{

`<Proxy.Provider />` 下面的所有 `<Markdown />` 都会被设置影响。
`<Proxy.Provider />` 下面的所有 `<Markdown />` 都会被设置影响。
下面是一个为所有的图片增加红色边框的例子。
下面是一个为所有的图片增加红色边框的例子。

@@ -159,0 +159,0 @@ ``` js

@@ -63,3 +63,3 @@ const babel = require('@babel/core');

const code = babel.transform(renderBody, {
presets: [babelEnv, babelReact],
presets: [babelReact],
plugins: [[plugin, {package: 'Markdown'}]]

@@ -153,1 +153,24 @@ }).code

});
test('transform to html with proxy esmodules', () => {
const renderBody = `import * as React from 'react';
import Markdown from 'Markdown/component';
function TestComponent() {
return (
<Markdown>
# Title
This is **bold.**
Here is a [link](/some/url).
</Markdown>
)
}`;
const code = babel.transform(renderBody, {
presets: [babelReact],
plugins: [[plugin, {package: 'Markdown', proxy: true}]]
}).code
expect(code).toMatchSnapshot();
});

@@ -0,0 +0,0 @@ const React = require('react');

@@ -0,0 +0,0 @@ const React = require('react');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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