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

remark-loader

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-loader - npm Package Compare versions

Comparing version 0.3.2 to 1.0.0-rc.0

README.md

17

CHANGELOG.md

@@ -5,2 +5,19 @@ # Change Log

<a name="1.0.0-rc.0"></a>
# [1.0.0-rc.0](https://github.com/skipjack/remark-loader/compare/v0.3.2...v1.0.0-rc.0) (2019-06-10)
### Chores
* remove react specific code ([f4e64c4](https://github.com/skipjack/remark-loader/commit/f4e64c4)), closes [#1](https://github.com/skipjack/remark-loader/issues/1)
### BREAKING CHANGES
* The `react` option has been removed. Our implementation
was extremely hacky and led to a bunch of pitfalls. Please use MDX as an
alternative.
<a name="0.3.2"></a>

@@ -7,0 +24,0 @@ ## [0.3.2](https://github.com/skipjack/remark-loader/compare/v0.3.1...v0.3.2) (2018-02-06)

4

package.json
{
"name": "remark-loader",
"version": "0.3.2",
"version": "1.0.0-rc.0",
"description": "Load markdown through remark with some react-specific features.",

@@ -28,6 +28,4 @@ "homepage": "",

"loader-utils": "^1.1.0",
"react": "^15.6.1",
"remark": "^8.0.0",
"remark-html": "^6.0.1",
"remark-react": "^4.0.0",
"vfile-reporter": "^4.0.0"

@@ -34,0 +32,0 @@ },

const Utils = require('loader-utils')
const HTMLLoader = require('html-loader')
const Parse = require('./parse.js')
const Build = require('./build.js')
const parse = require('./parse.js')

@@ -15,11 +14,10 @@ /**

Parse(content, options)
// TODO: Refactor this hack -- we should probably just intercept images in the tree
parse(content, options)
// @todo we should probably just intercept images in the tree
// or recommend that the `html-loader` be chained
.then(processed => Object.assign({}, processed, {
content: HTMLLoader(processed.content).replace('module.exports = ', 'export default ')
content: HTMLLoader(processed.content)
}))
// TODO: Ideally this should be enabled via remark-react or another plugin (discuss with the author)
.then(resolved => options.react ? Build(resolved) : resolved)
.then(resolved => callback(null, resolved.content))
.catch(callback)
};
const FrontMatter = require('front-matter')
const Remark = require('remark')
const RemarkHTML = require('remark-html')
const RemarkReact = require('remark-react')
const React = require('react')
const Report = require('vfile-reporter')

@@ -27,3 +25,3 @@

}, Remark())
.use(RemarkHTML) // RECONSIDER: options.output === 'html' ? RemarkHTML : RemarkReact)
.use(RemarkHTML)
.process(parsed.body, (err, file) => {

@@ -30,0 +28,0 @@ let result = {

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