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

@mapbox/hast-util-table-cell-style

Package Overview
Dependencies
Maintainers
223
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/hast-util-table-cell-style - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

4

CHANGELOG.md
# Changelog
## 0.1.2
- We're ok with end users on Node v4.
## 0.1.1

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

51

index.js

@@ -5,2 +5,9 @@ 'use strict';

const hastCssPropertyMap = {
align: 'text-align',
valign: 'vertical-align',
height: 'height',
width: 'width'
};
module.exports = function tableCellStyle(node) {

@@ -15,6 +22,10 @@ visit(node, 'element', visitor);

}
transformAlign(node);
transformValign(node);
transformHeight(node);
transformWidth(node);
Object.keys(hastCssPropertyMap).map(hastName => {
if (node.properties[hastName] === undefined) {
return;
}
const cssName = hastCssPropertyMap[hastName];
appendStyle(node, cssName, node.properties[hastName]);
delete node.properties[hastName];
});
}

@@ -33,33 +44,1 @@

}
function transformAlign(node) {
if (node.properties.align === undefined) {
return;
}
appendStyle(node, 'text-align', node.properties.align);
delete node.properties.align;
}
function transformValign(node) {
if (node.properties.valign === undefined) {
return;
}
appendStyle(node, 'vertical-align', node.properties.valign);
delete node.properties.valign;
}
function transformHeight(node) {
if (node.properties.height === undefined) {
return;
}
appendStyle(node, 'height', node.properties.height);
delete node.properties.height;
}
function transformWidth(node) {
if (node.properties.width === undefined) {
return;
}
appendStyle(node, 'width', node.properties.width);
delete node.properties.width;
}
{
"name": "@mapbox/hast-util-table-cell-style",
"version": "0.1.1",
"version": "0.1.2",
"description": "Transform deprecated styling attributes on HAST table cells to inline styles",

@@ -33,3 +33,3 @@ "main": "index.js",

"engines": {
"node": ">=6"
"node": ">=4"
},

@@ -36,0 +36,0 @@ "dependencies": {

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