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

markdownlint-rule-search-replace

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdownlint-rule-search-replace - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "markdownlint-rule-search-replace",
"version": "1.0.3",
"version": "1.0.4",
"description": "A custom markdownlint rule for search and replaces",

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

@@ -5,3 +5,3 @@ # markdownlint-rule-search-replace

![npm](https://img.shields.io/npm/v/markdownlint-rule-search-replace)
[![npm](https://img.shields.io/npm/v/markdownlint-rule-search-replace)](https://www.npmjs.com/package/markdownlint-rule-search-replace)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

@@ -74,3 +74,3 @@

- `searchPattern`: regex pattern to search. Include flags as well, as if you are defining a regex literal in JavaScript, e.g. `/http/g`.
- `replace`: The replacement string, e.g. `https`. Regex properties like `$1` can be used if `searchPattern` is being used.
- `replace`: Optional. The replacement string, e.g. `https`. Regex properties like `$1` can be used if `searchPattern` is being used.
- `skipCode`: Optional. All code(inline and block), which is inside backticks, will be skipped.

@@ -137,3 +137,3 @@

### With markdownlint api
### With markdownlint API

@@ -140,0 +140,0 @@ Add the rule object to the `customRules` array:

@@ -127,3 +127,3 @@ // @ts-check

if (typeof replacement !== "undefined") {
if (typeof replacement !== "undefined" && replacement !== null) {
options.fixInfo = {

@@ -179,5 +179,8 @@ lineNumber: lineNo + 1,

} else {
const replacement = rule.search
? rule.replace
: match.replace(new RegExp(regex), rule.replace);
let replacement = null;
if (typeof rule.replace !== "undefined") {
replacement = rule.search
? rule.replace
: match.replace(new RegExp(regex), rule.replace);
}
report(rule, match, lineNo, columnNo, replacement);

@@ -184,0 +187,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