fix: patch in #366 and #367 for marked-terminal

This commit is contained in:
Michael Bolin
2025-05-13 10:27:42 -07:00
parent 557f608f25
commit 70e9ff2fd7
4 changed files with 45 additions and 2 deletions

View File

@@ -29,6 +29,15 @@
"overrides": {
"punycode": "^2.3.1"
},
"pnpm": {
"patchedDependencies": {
"marked-terminal@7.3.0": "patches/marked-terminal@7.3.0.patch"
}
},
"files": [
"bin",
"dist"
],
"engines": {
"node": ">=22",
"pnpm": ">=9.0.0"

View File

@@ -0,0 +1,26 @@
diff --git a/index.cjs b/index.cjs
index 1afa52b2b7162a948e1d044babf3d456ff7feec7..27e632aa643fa77fc9f294782904be7d9991c13a 100644
--- a/index.cjs
+++ b/index.cjs
@@ -59430,7 +59430,7 @@ Renderer.prototype.space = function () {
Renderer.prototype.text = function (text) {
if (typeof text === 'object') {
- text = text.text;
+ text = text.tokens ? this.parser.parseInline(text.tokens) : text.text;
}
return this.o.text(text);
};
@@ -59532,10 +59532,10 @@ Renderer.prototype.listitem = function (text) {
}
var transform = compose(this.o.listitem, this.transform);
var isNested = text.indexOf('\n') !== -1;
- if (isNested) text = text.trim();
+ if (!isNested) text = transform(text);
// Use BULLET_POINT as a marker for ordered or unordered list item
- return '\n' + BULLET_POINT + transform(text);
+ return '\n' + BULLET_POINT + text;
};
Renderer.prototype.checkbox = function (checked) {

9
pnpm-lock.yaml generated
View File

@@ -9,6 +9,11 @@ overrides:
micromatch: ^4.0.8
semver: ^7.7.1
patchedDependencies:
marked-terminal@7.3.0:
hash: b5a123772349b9cee9201d486a95ced91002bbfab64972dd67399453154bbc8d
path: patches/marked-terminal@7.3.0.patch
importers:
.:
@@ -66,7 +71,7 @@ importers:
version: 15.0.8
marked-terminal:
specifier: ^7.3.0
version: 7.3.0(marked@15.0.8)
version: 7.3.0(patch_hash=b5a123772349b9cee9201d486a95ced91002bbfab64972dd67399453154bbc8d)(marked@15.0.8)
meow:
specifier: ^13.2.0
version: 13.2.0
@@ -4105,7 +4110,7 @@ snapshots:
make-error@1.3.6: {}
marked-terminal@7.3.0(marked@15.0.8):
marked-terminal@7.3.0(patch_hash=b5a123772349b9cee9201d486a95ced91002bbfab64972dd67399453154bbc8d)(marked@15.0.8):
dependencies:
ansi-escapes: 7.0.0
ansi-regex: 6.1.0

View File

@@ -5,3 +5,6 @@ packages:
ignoredBuiltDependencies:
- esbuild
patchedDependencies:
marked-terminal@7.3.0: patches/marked-terminal@7.3.0.patch