Socket
Socket
Sign inDemoInstall

minimize

Package Overview
Dependencies
58
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.0 to 0.4.1

8

lib/helpers.js

@@ -24,3 +24,5 @@ 'use strict';

, structural = /pre|textarea|code/
, interpunction = /[\.,!%;:\-\?]/;
, interpunction = /[\.,!%;:\-\?]/
, start = new RegExp('^' + interpunction.source)
, end = new RegExp(interpunction.source + '$');

@@ -74,3 +76,3 @@ /**

return (this.isInline(element) && (flow.test(data) || interpunction.test(data))
return (this.isInline(element) && (flow.test(data) || end.test(data))
? ' <'

@@ -141,3 +143,3 @@ : '<') + element.data + '>';

// Check if the text requires flowing based on last output and interpunction.
if (flow.test(data) && !(new RegExp('^' + interpunction.source)).test(element)) {
if (flow.test(data) && !start.test(element)) {
element = ' ' + element;

@@ -144,0 +146,0 @@ }

{
"name": "minimize",
"version": "0.4.0",
"version": "0.4.1",
"description": "Minimize HTML",

@@ -5,0 +5,0 @@ "main": "./lib/minimize",

@@ -117,3 +117,3 @@ 'use strict';

it('is inline and prepended by text', function () {
expect(helpers.tag(html.inline), html.element, 'text').to.be.equal(
expect(helpers.tag(html.inline, 'text')).to.be.equal(
' <' + html.inline.data + '>'

@@ -125,4 +125,12 @@ );

it('is inline and prepended by interpunction', function () {
expect(helpers.tag(html.inline, 'text.')).to.be.equal(
' <' + html.inline.data + '>'
);
expect(structure).to.be.calledOnce;
});
it('is inline and prepended by closing tag', function () {
expect(helpers.tag(html.inline), html.element, 'text</b>').to.be.equal(
expect(helpers.tag(html.inline, 'text</b>')).to.be.equal(
' <' + html.inline.data + '>'

@@ -129,0 +137,0 @@ );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc