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

brightml

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brightml - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

12

index.js

@@ -5,3 +5,2 @@ var fs = require('fs');

var cheerio = require('cheerio');
var normall = require('normall');

@@ -159,3 +158,3 @@ var rules = require('./rules');

var oldId = $(this).attr('id');
var textId = normall.filename($(this).text());
var textId = normalizeId($(this).text());

@@ -180,2 +179,11 @@ var newId = textId;

// Normalize an id
function normalizeId(id) {
// Replace any non alpha-numeric character by an hyphen
id = id.replace(/[^a-zA-Z\d]+/g, '-');
// Make lowercase
id = id.toLowerCase();
return id;
};
// For empty <a> tags with an id attribute, set id on parent

@@ -182,0 +190,0 @@ function setAnchorsId() {

5

package.json
{
"name": "brightml",
"version": "3.0.1",
"version": "3.0.2",
"description": "Smart utility rendering markdown-ready HTML",

@@ -23,4 +23,3 @@ "main": "index.js",

"cheerio": "git://github.com/cheeriojs/cheerio.git#70c5608113d3efaf584efd29edafe173b74e106f",
"lodash": "^3.10.1",
"normall": "^0.2.2"
"lodash": "^3.10.1"
},

@@ -27,0 +26,0 @@ "scripts": {

@@ -220,7 +220,7 @@ var should = require('should');

var input = '<h1 id="345-is-a-weird-id">'+
'Sample title'+
'Complex_title 101&amp;# Others'+
'</h1>';
var correctOutput = '<h1 id="sample_title">'+
'Sample title'+
var correctOutput = '<h1 id="complex-title-101-others">'+
'Complex_title 101&amp;# Others'+
'</h1>';

@@ -243,6 +243,6 @@

var correctOutput = '<h2 id="a_great_title">'+
var correctOutput = '<h2 id="a-great-title">'+
'A great title'+
'</h2>'+
'<a href="#a_great_title">'+
'<a href="#a-great-title">'+
'Go back'+

@@ -455,3 +455,3 @@ '</a>';

var correctOutput = '<h1 id="part_1">Part 1</h1>'+
var correctOutput = '<h1 id="part-1">Part 1</h1>'+
'<p>'+

@@ -483,5 +483,5 @@ 'Sample footnote'+

'</p>'+
'<h1 id="part_2">Part 2</h1>'+
'<h1 id="part-2">Part 2</h1>'+
'<p>Some content</p>'+
'<h1 id="part_3">Part 3</h1>'+
'<h1 id="part-3">Part 3</h1>'+
'<caption>Data table</caption>'+

@@ -488,0 +488,0 @@ '<table>'+

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