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

remark-lint-no-heading-like-paragraph

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-lint-no-heading-like-paragraph - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

37

index.js

@@ -26,27 +26,34 @@ /**

'use strict';
'use strict'
var rule = require('unified-lint-rule');
var visit = require('unist-util-visit');
var generated = require('unist-util-generated');
var rule = require('unified-lint-rule')
var visit = require('unist-util-visit')
var generated = require('unist-util-generated')
module.exports = rule('remark-lint:no-heading-like-paragraph', noHeadingLikeParagraph);
module.exports = rule(
'remark-lint:no-heading-like-paragraph',
noHeadingLikeParagraph
)
var fence = '#######';
var fence = '#######'
var reason = 'This looks like a heading but has too many hashes'
function noHeadingLikeParagraph(tree, file) {
visit(tree, 'paragraph', visitor);
visit(tree, 'paragraph', visitor)
function visitor(node) {
var head = node.children[0];
var head
if (
head &&
head.type === 'text' &&
head.value.slice(0, fence.length) === fence &&
!generated(node)
) {
file.message('This looks like a heading but has too many hashes', node);
if (!generated(node)) {
head = node.children[0]
if (
head &&
head.type === 'text' &&
head.value.slice(0, fence.length) === fence
) {
file.message(reason, node)
}
}
}
}
{
"name": "remark-lint-no-heading-like-paragraph",
"version": "1.0.1",
"version": "1.0.2",
"description": "remark-lint rule to for too many hashes (h7+ “headings”)",

@@ -13,4 +13,4 @@ "license": "MIT",

],
"repository": "https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-no-heading-like-paragraph",
"bugs": "https://github.com/wooorm/remark-lint/issues",
"repository": "https://github.com/remarkjs/remark-lint/tree/master/packages/remark-lint-no-heading-like-paragraph",
"bugs": "https://github.com/remarkjs/remark-lint/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",

@@ -17,0 +17,0 @@ "contributors": [

@@ -88,2 +88,2 @@ <!--This file is generated-->

[MIT](https://github.com/wooorm/remark-lint/blob/master/LICENSE) © [Titus Wormer](http://wooorm.com)
[MIT](https://github.com/remarkjs/remark-lint/blob/master/LICENSE) © [Titus Wormer](http://wooorm.com)
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