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 3.0.8 to 3.0.10

images/terminal.png

4

lib/tag-helpers/text-node.js

@@ -15,6 +15,6 @@ import he from 'he';

const normalized = [...normalizeWhitespace(tag.value).replace(/\n/g, ' ')];
const normalized = [...normalizeWhitespace(tag.value).replaceAll('\n', ' ')];
const pre = [' ', '\n'].includes(normalized[0]) ? normalized.shift() : null;
const post = [' ', '\n'].includes(normalized[normalized.length - 1]) ? normalized.pop() : null;
const post = [' ', '\n'].includes(normalized.at(-1)) ? normalized.pop() : null;

@@ -21,0 +21,0 @@ return {

@@ -30,5 +30,8 @@ import chalk from 'chalk';

export const figcaption = blockTag((value) => chalk.bgGreen.bold(` § ${value} `), {
marginTop: 1,
marginBottom: 1,
});
export const figcaption = blockTag(
(value) => chalk.bgGreen.bold(` ${value} `),
{
marginTop: 1,
marginBottom: 1,
},
);

@@ -12,3 +12,3 @@ import chalk from 'chalk';

const content = value[value.length - 1] === '\n' ? value.slice(0, -1) : value;
const content = value.at(-1) === '\n' ? value.slice(0, -1) : value;

@@ -28,3 +28,3 @@ let langName = null;

const codeValue = langName
? (highlight(content, {
? highlight(content, {
language: langName,

@@ -34,4 +34,4 @@ theme: {

},
}))
: chalk.yellow(content);
})
: chalk.red(content);

@@ -48,3 +48,5 @@ if (tag.parentNode.nodeName !== 'pre') {

const codeContent = codeValueLines.map(
(codeLine, index) => `${chalk.black.bold(`${index + 1}`.padStart(codeLinesLength, ' '))} ${indentify(
(codeLine, index) => `${chalk.blackBright.dim(
`${index + 1}`.padStart(codeLinesLength, ' '),
)} ${indentify(
pad,

@@ -51,0 +53,0 @@ true,

@@ -12,3 +12,3 @@ import boxen from 'boxen';

(value) => `${boxen(value || '', {
title: summary && summary.value ? `> ${summary.value.replace(/\n/g, ' ')}` : '> Summary',
title: summary && summary.value ? `> ${summary.value.replaceAll('\n', ' ')}` : '> Summary',
dimTitle: false,

@@ -15,0 +15,0 @@ titleColor: 'red',

@@ -12,3 +12,3 @@ import boxen_ from 'boxen';

(value) => `${boxen_(value, {
title: summary && summary.value ? summary.value.replace(/\n/g, ' ') : null,
title: summary && summary.value ? summary.value.replaceAll('\n', ' ') : null,
dimTitle: false,

@@ -15,0 +15,0 @@ titleColor: 'yellow',

@@ -5,25 +5,25 @@ import chalk from 'chalk';

export const h1 = blockTag((value) => chalk.bgBlue.bold(` § ${value} `), {
export const h1 = blockTag((value) => chalk.blue.bold(` # ${value} `), {
marginTop: 2,
marginBottom: 1,
});
export const h2 = blockTag((value) => chalk.bgBlueBright.bold(` § ${value} `), {
export const h2 = blockTag((value) => chalk.blue.bold(` ## ${value} `), {
marginTop: 1,
marginBottom: 1,
});
export const h3 = blockTag((value) => chalk.bgCyan.bold(` § ${value} `), {
export const h3 = blockTag((value) => chalk.blue.bold(` ### ${value} `), {
marginTop: 1,
marginBottom: 1,
});
export const h4 = blockTag((value) => ` ${chalk.blue.bold(`§ ${value}`)}`, {
export const h4 = blockTag((value) => chalk.cyan.bold(` #### ${value}`), {
marginTop: 1,
marginBottom: 1,
});
export const h5 = blockTag((value) => ` ${chalk.blueBright(`§ ${value}`)}`, {
export const h5 = blockTag((value) => chalk.cyan(` ##### ${value}`), {
marginTop: 1,
marginBottom: 1,
});
export const h6 = blockTag((value) => ` ${chalk.cyan(`§ ${value}`)}`, {
export const h6 = blockTag((value) => chalk.cyan(` ###### ${value}`), {
marginTop: 1,
marginBottom: 1,
});

@@ -24,11 +24,5 @@ import chalk from 'chalk';

pre: null,
value: `${
grey('[')
}${
getAttribute(tag, 'checked', ' ') === ''
? red.bold('☓')
: red.bold(' ')
}${
grey(']')
}`,
value: `${grey('[')}${
getAttribute(tag, 'checked', ' ') === '' ? red.bold('✓') : red.bold(' ')
}${grey(']')}`,
post: null,

@@ -43,11 +37,5 @@ type: 'inline',

pre: null,
value: `${
grey('(')
}${
getAttribute(tag, 'checked', ' ') === ''
? red.bold('☓')
: red.bold(' ')
}${
grey(')')
}`,
value: `${grey('(')}${
getAttribute(tag, 'checked', ' ') === '' ? red.bold('•') : red.bold(' ')
}${grey(')')}`,
post: null,

@@ -54,0 +42,0 @@ type: 'inline',

@@ -7,6 +7,3 @@ import chalk from 'chalk';

const {
blue,
red,
} = chalk;
const { blueBright, redBright } = chalk;

@@ -45,5 +42,7 @@ export const ol = (tag, context) => {

if (context.orderedList) {
return blockTag((value) => `${blue(
`${getListItemNumber(context.liItemNumber, context.listType)}.`,
)} ${indentify(' ', true)(value)}`)(tag, { ...context, lineWidth: context.lineWidth - 3 });
return blockTag(
(value) => `${blueBright(
`${getListItemNumber(context.liItemNumber, context.listType)}.`,
)} ${indentify(' ', true)(value)}`,
)(tag, { ...context, lineWidth: context.lineWidth - 3 });
}

@@ -53,4 +52,4 @@

/ {2}/,
`${red(getListSymbol(context.listType))} `,
`${redBright(getListSymbol(context.listType))} `,
))(tag, { ...context, lineWidth: context.lineWidth - 2 });
};

@@ -27,5 +27,4 @@ import ansiAlign from 'ansi-align';

const theadTdsValue = !theadTds
? null
: theadTds.map((tag, context) => {
const theadTdsValue = theadTds
? theadTds.map((tag, context) => {
const det = tag.nodeName === 'td' ? td(tag, context) : th(tag, context);

@@ -50,3 +49,4 @@

};
});
})
: null;
return theadTdsValue;

@@ -56,5 +56,5 @@ };

const tbodyVals = (tbody) => {
const theadTrs = !tbody
? null
: tbody.childNodes.filter((tag) => ['tr'].includes(tag.nodeName));
const theadTrs = tbody
? tbody.childNodes.filter((tag) => ['tr'].includes(tag.nodeName))
: null;

@@ -85,3 +85,3 @@ const theadTrsVals = theadTrs.map(trVals);

const theadsValue = !theadTr ? null : trVals(theadTr);
const theadsValue = theadTr ? trVals(theadTr) : null;

@@ -102,3 +102,3 @@ if (theadsValue && theadsValue[0]) {

const tfootdsValue = !tfootTr ? null : trVals(tfootTr);
const tfootdsValue = tfootTr ? trVals(tfootTr) : null;

@@ -105,0 +105,0 @@ if (tfootdsValue && tfootdsValue[0]) {

@@ -22,9 +22,9 @@ /* eslint-disable unicorn/no-nested-ternary */

post:
first.post != null
? first.post
: second.pre != null
? second.pre
: second.post != null
? second.post
: '',
first.post == null
? second.pre == null
? second.post == null
? ''
: second.post
: second.pre
: first.post,
};

@@ -36,9 +36,9 @@ }

pre:
first.pre != null
? first.pre
: first.post != null
? first.post
: second.pre != null
? second.pre
: '',
first.pre == null
? first.post == null
? second.pre == null
? ''
: second.pre
: first.post
: first.pre,
value: second.value,

@@ -45,0 +45,0 @@ post: second.post,

{
"name": "cli-html",
"version": "3.0.8",
"version": "3.0.10",
"description": "Render HTML to Terminal",

@@ -35,4 +35,4 @@ "main": "index.js",

"ansi-align": "^3.0.1",
"ansi-escapes": "^6.0.0",
"boxen": "^7.0.1",
"ansi-escapes": "^6.2.0",
"boxen": "^7.1.0",
"chalk": "^5.2.0",

@@ -53,13 +53,13 @@ "change-case": "^4.1.2",

"romanize": "^1.1.1",
"supports-hyperlinks": "^2.3.0",
"supports-hyperlinks": "^3.0.0",
"term-size": "^3.0.1",
"wrap-ansi": "^8.0.1"
"wrap-ansi": "^8.1.0"
},
"devDependencies": {
"confusing-browser-globals": "^1.0.11",
"eslint": "^8.32.0",
"eslint": "^8.43.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-standard-jsdoc": "^9.3.0",
"eslint-plugin-async-await": "0.0.0",
"eslint-plugin-jsdoc": "^39.6.6",
"eslint-plugin-jsdoc": "^46.2.6",
"eslint-plugin-json": "^3.1.0",

@@ -69,5 +69,5 @@ "eslint-plugin-no-loops": "^0.3.0",

"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-simple-import-sort": "^9.0.0",
"eslint-plugin-unicorn": "^45.0.2"
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unicorn": "^47.0.0"
}
}

@@ -26,3 +26,3 @@ # Welcome to cli-html

![Screenshot of cli-html](./images/1.png)
![Screenshot of cli-html](./images/terminal.png)

@@ -29,0 +29,0 @@ ## Usage as module

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