Comparing version 1.5.5 to 1.5.6
const parse5 = require('parse5'); | ||
const htmlparser2Adapter = require('parse5-htmlparser2-tree-adapter'); | ||
@@ -4,0 +3,0 @@ const { filterAst } = require('./lib/utils'); |
@@ -44,3 +44,5 @@ /* eslint-disable unicorn/consistent-function-scoping */ | ||
if (!context.pre) { | ||
accumulator.inline.value = wrapLineWidth(accumulator.inline.value, context.lineWidth, context.pre); | ||
accumulator.inline.value = wrapLineWidth( | ||
accumulator.inline.value, context.lineWidth, context.pre, | ||
); | ||
} | ||
@@ -64,3 +66,5 @@ } | ||
if (!context.pre) { | ||
value.inline.value = wrapLineWidth(value.inline.value, context.lineWidth, context.pre); | ||
value.inline.value = wrapLineWidth( | ||
value.inline.value, context.lineWidth, context.pre, | ||
); | ||
} | ||
@@ -77,3 +81,2 @@ } | ||
topBlock = (!context || !context.pre) | ||
@@ -89,3 +92,2 @@ ? topBlock + 1 | ||
return { | ||
@@ -92,0 +94,0 @@ marginTop: (value.block.marginTop |
@@ -6,3 +6,3 @@ /* eslint-disable unicorn/consistent-function-scoping */ | ||
const inlineTag = (wrapper, localContext, options) => (tag, context) => { | ||
const inlineTag = (wrapper) => (tag, context) => { | ||
const wrapFn = wrapper || ((argument) => (argument)); | ||
@@ -9,0 +9,0 @@ |
@@ -1,2 +0,1 @@ | ||
const compose = require('compose-function'); | ||
const blockTag = require('../tag-helpers/blockTag'); | ||
@@ -12,23 +11,19 @@ const inlineTag = require('../tag-helpers/inlineTag'); | ||
const blockWithNewlines = blockTag( | ||
compose( | ||
(value) => `${value}`, | ||
), { marginTop: 1, marginBottom: 1 }, | ||
(value) => value, | ||
{ marginTop: 1, marginBottom: 1 }, | ||
); | ||
const title = blockTag( | ||
compose( | ||
(value) => `${boxen(ansiStyles.blue.bold(value), { | ||
padding: { | ||
top: 0, | ||
bottom: 0, | ||
left: 4, | ||
right: 4, | ||
}, | ||
borderColor: 'gray', | ||
borderStyle: 'bold', | ||
})}`, | ||
), | ||
(value) => boxen(ansiStyles.blue.bold(value), { | ||
padding: { | ||
top: 0, | ||
bottom: 0, | ||
left: 4, | ||
right: 4, | ||
}, | ||
borderColor: 'gray', | ||
borderStyle: 'bold', | ||
}), | ||
); | ||
module.exports.title = title; | ||
@@ -35,0 +30,0 @@ |
@@ -48,33 +48,9 @@ /* eslint-disable unicorn/no-nested-ternary */ | ||
if (first.marginBottom && second.marginTop) { | ||
return { | ||
marginTop: first.marginTop, | ||
value: `${first.value}${ | ||
first.marginBottom > second.marginTop | ||
? ('\n').repeat((first.marginBottom || 0)) | ||
: ('\n').repeat((second.marginTop || 0)) | ||
}${second.value}`, | ||
marginBottom: second.marginBottom, | ||
}; | ||
} | ||
if (first.marginBottom) { | ||
return { | ||
marginTop: first.marginTop, | ||
value: `${first.value}${('\n').repeat((first.marginBottom || 0))}${second.value}`, | ||
marginBottom: second.marginBottom, | ||
}; | ||
} | ||
if (second.marginTop) { | ||
return { | ||
marginTop: first.marginTop, | ||
value: `${first.value}${('\n').repeat((second.marginTop || 0))}${second.value}`, | ||
marginBottom: second.marginBottom, | ||
}; | ||
} | ||
return { | ||
marginTop: first.marginTop, | ||
value: `${first.value}\n${second.value}`, | ||
value: `${first.value}${ | ||
first.marginBottom > second.marginTop | ||
? ('\n').repeat((first.marginBottom || 0)) | ||
: ('\n').repeat((second.marginTop || 0)) | ||
}${second.value}`, | ||
marginBottom: second.marginBottom, | ||
@@ -81,0 +57,0 @@ }; |
@@ -8,6 +8,6 @@ const inlineToBlockTag = (value) => { | ||
...value, | ||
pre: null, | ||
post: null, | ||
marginTop: 0, | ||
marginBottom: 0, | ||
type: 'block', | ||
nodeName: 'div', | ||
nodeName: '#blockTag', | ||
}; | ||
@@ -14,0 +14,0 @@ }; |
{ | ||
"name": "cli-html", | ||
"version": "1.5.5", | ||
"version": "1.5.6", | ||
"description": "There will be cli module who render HTML to Terminal", | ||
@@ -63,3 +63,3 @@ "main": "index.js", | ||
"eslint-plugin-jquery": "^1.5.1", | ||
"eslint-plugin-jsdoc": "^18.1.2", | ||
"eslint-plugin-jsdoc": "^18.1.4", | ||
"eslint-plugin-json": "^2.0.1", | ||
@@ -66,0 +66,0 @@ "eslint-plugin-no-loops": "^0.3.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53
199723
1159