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

@slate-serializers/dom

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slate-serializers/dom - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

5

package.json
{
"name": "@slate-serializers/dom",
"version": "2.2.1",
"version": "2.2.2",
"description": "Serialize Slate JSON objects to the DOM. Can be used with `htmlparser2` and associated utilities to modify the DOM and generate HTML. Used by other serializers in this monorepo.",

@@ -16,3 +16,4 @@ "type": "commonjs",

},
"main": "./src/index.js"
"main": "./src/index.js",
"types": "./src/index.d.ts"
}

12

src/lib/config/payload.js

@@ -6,2 +6,3 @@ "use strict";

const default_1 = require("./default");
const utilities_1 = require("../utilities");
/**

@@ -12,3 +13,12 @@ * Configuration for Payload CMS

*/
exports.config = Object.assign(Object.assign({}, default_1.config), { elementTransforms: Object.assign(Object.assign({}, default_1.config.elementTransforms), { link: ({ node, children = [] }) => {
exports.config = Object.assign(Object.assign({}, default_1.config), { elementAttributeTransform: ({ node }) => {
if (node.align || node.textAlign) {
return {
style: (0, utilities_1.styleToString)({
['text-align']: node.align || node.textAlign,
})
};
}
return;
}, elementTransforms: Object.assign(Object.assign({}, default_1.config.elementTransforms), { link: ({ node, children = [] }) => {
const attrs = {};

@@ -15,0 +25,0 @@ if (node.linkType) {

@@ -97,3 +97,3 @@ "use strict";

if (!element && config.defaultTag && !node.type) {
element = transformElement(new domhandler_1.Element(config.defaultTag, {}, children));
element = transformElement(new domhandler_1.Element(config.defaultTag, attribs, children));
}

@@ -100,0 +100,0 @@ if (element) {

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