New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

markdown-magic

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-magic - npm Package Compare versions

Comparing version 0.1.21 to 0.1.22

10

lib/processFile.js

@@ -71,3 +71,4 @@ "use strict" // eslint-disable-line

transformsFound.push({
transform: commentMatches[1],
spaces: commentMatches[1], // Preserve indentation
transform: commentMatches[2],
match: match[matchIndex]

@@ -91,3 +92,8 @@ })

const newContent = updateContents(element.match, mergedConfig)
content = content.replace(element.match, newContent)
const firstLineIndentation = element.spaces
const contentWithIndentation = newContent.split('\n').join(`\n` + element.spaces)
const preserveTabs = `${firstLineIndentation}${contentWithIndentation}`
content = content.replace(element.match, preserveTabs)
mergedConfig.outputContent = content

@@ -94,0 +100,0 @@ })

2

lib/utils/regex.js

@@ -5,3 +5,3 @@ "use strict" // eslint-disable-line

//return new RegExp(`(?:\\<\\!--(?:.|\\r?\\n)*?${matchWord}:START(?:.|\\r?\\n)*?\\()(.*)\\)(?:.|\\r?\\n)*?<!--(?:.|\\r?\\n)*?${matchWord}:END(?:.|\\r?\\n)*?--\\>`, 'g')
return new RegExp(`(?:\\<\\!--(?:.*|\r?|\n?|\s*)${matchWord}:START(?:.|\\r?\\n)*?\\()(.*)\\)(?:.|\\r?\\n)*?<!--(?:.*|\r?|\n?|\s*)${matchWord}:END(?:.|\\r?\\n)*?--\\>`, 'g')
return new RegExp(`(.*)(?:\\<\\!--(?:.*|\r?|\n?|\s*)${matchWord}:START(?:.|\\r?\\n)*?\\()(.*)\\)(?:.|\\r?\\n)*?<!--(?:.*|\r?|\n?|\s*)${matchWord}:END(?:.|\\r?\\n)*?--\\>`, 'g')
}

@@ -8,0 +8,0 @@

{
"name": "markdown-magic",
"version": "0.1.21",
"version": "0.1.22",
"description": "Automatically update markdown files with content from external sources",

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

@@ -7,3 +7,3 @@ # Markdown Magic [![npm-version][npm-badge]][npm-link]

<img align="right" width="200" height="183" src="https://cloud.githubusercontent.com/assets/532272/21507867/3376e9fe-cc4a-11e6-9350-7ec4f680da36.gif">Markdown magic uses comment blocks in markdown files to automatically sync or transform it's contents.
<img align="right" width="200" height="183" src="https://cloud.githubusercontent.com/assets/532272/21507867/3376e9fe-cc4a-11e6-9350-7ec4f680da36.gif">Markdown magic uses comment blocks in markdown files to automatically sync or transform its contents.

@@ -349,2 +349,2 @@ - Automatically keep markdown files up to date from local or remote code sources

[mit]: http://opensource.org/licenses/MIT
[author]: http://github.com/davidwells
[author]: http://github.com/davidwells
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