Socket
Socket
Sign inDemoInstall

@tryghost/kg-parser-plugins

Package Overview
Dependencies
Maintainers
11
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

10

index.js
/**
* Copied from:
* https://github.com/TryGhost/Ghost-Admin/blob/1f3d77d7230dd47a7eb5f38b90dfa510b2a16801/lib/koenig-editor/addon/options/parser-plugins.js
* Which makes use of:
* https://github.com/TryGhost/Ghost-Admin/blob/1f3d77d7230dd47a7eb5f38b90dfa510b2a16801/lib/koenig-editor/addon/helpers/clean-basic-html.js
*

@@ -41,2 +43,4 @@ * These functions are used to proces nodes during parsing from DOM -> mobiledoc

let figcaption = node.querySelector('figcaption');
let kgClass = node.className.match(/kg-width-(wide|full)/);
let grafClass = node.className.match(/graf--layout(FillWidth|OutsetCenter)/);

@@ -53,2 +57,8 @@ if (!img) {

if (kgClass) {
payload.cardWidth = kgClass[1];
} else if (grafClass) {
payload.cardWidth = grafClass[1] === 'FillWidth' ? 'full' : 'wide';
}
if (figcaption) {

@@ -55,0 +65,0 @@ // @TODO: resolve browser vs node env here

8

package.json
{
"name": "@tryghost/kg-parser-plugins",
"version": "0.1.0",
"version": "0.2.0",
"repository": "https://github.com/TryGhost/Ghost-SDK/tree/master/packages/kg-parser-plugins",

@@ -14,2 +14,5 @@ "author": "Ghost Foundation",

},
"publishConfig": {
"access": "public"
},
"devDependencies": {

@@ -19,3 +22,4 @@ "mocha": "5.2.0",

"sinon": "6.3.5"
}
},
"gitHead": "0b00508a0359dd6d34e9844de9a3ee271c9c9a7b"
}

@@ -1,3 +0,5 @@

# Kg Parser Plugins
# Koenig Parser Plugins
Plugins for parsing HTML back into Ghost Mobiledoc Cards
## Install

@@ -14,3 +16,5 @@

Used as part of the Koenig editor. See also: [html-to-mobiledoc](https://github.com/TryGhost/Ghost-SDK/tree/master/packages/html-to-mobiledoc)
## Develop

@@ -36,6 +40,4 @@

# Copyright & License
Copyright (c) 2018 Ghost Foundation - Released under the [MIT license](LICENSE).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc