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

cli-html

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-html - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

lib/tags/span.js

2

lib/tags.js

@@ -23,3 +23,2 @@ import { blockTag } from './tag-helpers/block-tag.js';

section,
span,
} from './tags/base-tags.js';

@@ -43,2 +42,3 @@ import { blockquote } from './tags/blockquote.js';

import { progress } from './tags/progress.js';
import { span } from './tags/span.js';
import { caption, table } from './tags/table.js';

@@ -45,0 +45,0 @@ import {

@@ -10,3 +10,2 @@ import { blockTag } from '../tag-helpers/block-tag.js';

export const span = inline;
export const label = inline;

@@ -13,0 +12,0 @@ export const blink = inline;

@@ -1,11 +0,23 @@

import compose from 'compose-function';
import chalkString from 'chalk-string';
import { blockTag } from '../tag-helpers/block-tag.js';
import { indentify } from '../utils.js';
import { getAttribute, getColorFromClass, indentify } from '../utils.js';
export const blockquote = (tag, context) => blockTag(
compose(
indentify(context.theme.blockquote('│ '), false),
),
{ marginTop: 1, marginBottom: 1 },
)(tag, { ...context, lineWidth: context.lineWidth - 2 });
const newStyle = chalkString();
export const blockquote = (tag, context) => {
const classAttributes = getAttribute(tag, 'class', '')
?.split(' ')
?.find((classAttribute) => classAttribute.startsWith('x-cli-color-'));
const color = getColorFromClass(classAttributes);
return blockTag(
indentify(
color ? newStyle(color, '│ ') : context.theme.blockquote('│ '),
false,
),
{ marginTop: 1, marginBottom: 1 },
)(tag, { ...context, lineWidth: context.lineWidth - 2 });
};

@@ -51,9 +51,9 @@ import chalk from 'chalk';

)(
wrapAnsi(codeLine, context.lineWidth - pad.length - 2, {
wrapAnsi(`|${codeLine}|`, context.lineWidth - pad.length - 2, {
trim: true,
}),
}).slice(1, -1),
)}`,
);
return indentify('', false)(codeContent.join('\n'));
return indentify(' ', false)(codeContent.join('\n'));
})(tag, context);

@@ -60,0 +60,0 @@

@@ -64,1 +64,9 @@ export const filterAst = (ast) => {

};
export const getColorFromClass = (classAttribute = '') => {
if (classAttribute?.startsWith('x-cli-color-')) {
return classAttribute?.slice(12);
}
return null;
};
{
"name": "cli-html",
"version": "4.1.0",
"version": "4.2.0",
"description": "Render HTML to Terminal",

@@ -14,2 +14,6 @@ "main": "index.js",

},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"author": "Grigorii Horos",

@@ -29,3 +33,2 @@ "license": "GPL3",

},
"engines": {},
"homepage": "https://github.com/horosgrisa/cli-html",

@@ -32,0 +35,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