New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ridi/epub-parser

Package Overview
Dependencies
Maintainers
9
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ridi/epub-parser - npm Package Compare versions

Comparing version 0.6.10 to 0.6.11

40

lib/loader/spineLoader.js

@@ -48,2 +48,4 @@ 'use strict';

DOCTYPE: '!doctype',
HTML: 'html',
BODY: 'body',
STYLE: 'style',

@@ -156,2 +158,32 @@ A: 'a',

function getSafeBody(ast) {
var BODY = Names.Tags.BODY;
var body = ast.find(function (child) {
return child.tagName === BODY;
});
if ((0, _parserCore.isExists)(body)) return body;
return {
type: 'element',
tagName: BODY,
attributes: [],
children: _parserCore.isArray ? ast : [ast]
};
}
function getSafeHtml(ast) {
var HTML = Names.Tags.HTML;
var html = ast.find(function (child) {
return child.tagName === HTML;
});
if ((0, _parserCore.isExists)(html)) return html;
return {
type: 'element',
tagName: HTML,
attributes: [],
children: [getSafeBody(ast)]
};
}
function spineLoader(spineItem, string) {

@@ -164,8 +196,4 @@ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

if (stringifyOptions.extractBody) {
var html = ast.find(function (child) {
return child.tagName === 'html';
});
var body = html.children.find(function (child) {
return child.tagName === 'body';
});
var html = getSafeHtml(ast);
var body = getSafeBody(html.children);
var attrs = body.attributes;

@@ -172,0 +200,0 @@ if ((0, _parserCore.isExists)(spineItem.styles)) {

4

package.json
{
"name": "@ridi/epub-parser",
"version": "0.6.10",
"version": "0.6.11",
"description": "Common EPUB2 data parser for Ridibooks services",

@@ -31,3 +31,3 @@ "author": {

"dependencies": {
"@ridi/parser-core": "0.6.10",
"@ridi/parser-core": "0.6.11",
"css-tree": "^1.0.0-alpha.29",

@@ -34,0 +34,0 @@ "fast-xml-parser": "^3.12.17",

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