@haklex/rich-litexml-cli 0.15.5 → 0.15.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +27 -11
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -44,6 +44,9 @@ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["modu
|
|
|
44
44
|
var require$1 = createRequire(import.meta.url);
|
|
45
45
|
function resolveComposeAsset(name) {
|
|
46
46
|
const candidates = [];
|
|
47
|
+
try {
|
|
48
|
+
candidates.push(require$1.resolve(`@haklex/rich-compose/${name}`));
|
|
49
|
+
} catch {}
|
|
47
50
|
try {
|
|
48
51
|
const pkgPath = require$1.resolve("@haklex/rich-compose/package.json");
|
|
49
52
|
candidates.push(path.join(path.dirname(pkgPath), "dist", name));
|
|
@@ -22386,16 +22389,24 @@ function createReaderContext(registry) {
|
|
|
22386
22389
|
parseChildren(element) {
|
|
22387
22390
|
const blockLevel = isBlockContainer(element);
|
|
22388
22391
|
const nodes = [];
|
|
22389
|
-
|
|
22390
|
-
|
|
22391
|
-
if (
|
|
22392
|
-
if (
|
|
22393
|
-
|
|
22394
|
-
|
|
22392
|
+
let pendingText = "";
|
|
22393
|
+
const flushText = () => {
|
|
22394
|
+
if (pendingText === "") return;
|
|
22395
|
+
if (blockLevel && pendingText.trim() === "") {
|
|
22396
|
+
pendingText = "";
|
|
22397
|
+
return;
|
|
22398
|
+
}
|
|
22399
|
+
nodes.push(makeTextNode(pendingText, 0));
|
|
22400
|
+
pendingText = "";
|
|
22401
|
+
};
|
|
22402
|
+
for (const child of element.childNodes) if (child.nodeType === 3) pendingText += child.textContent ?? "";
|
|
22403
|
+
else if (child.nodeType === 1) {
|
|
22404
|
+
flushText();
|
|
22395
22405
|
const parsed = parseElement(child, registry, ctx, 0);
|
|
22396
22406
|
if (parsed) if (Array.isArray(parsed)) nodes.push(...parsed);
|
|
22397
22407
|
else nodes.push(parsed);
|
|
22398
22408
|
}
|
|
22409
|
+
flushText();
|
|
22399
22410
|
return nodes;
|
|
22400
22411
|
},
|
|
22401
22412
|
parseNestedState(xml) {
|
|
@@ -22421,15 +22432,20 @@ function parseElement(element, registry, ctx, inheritedFormat) {
|
|
|
22421
22432
|
}
|
|
22422
22433
|
function parseInlineChildren(element, registry, ctx, format) {
|
|
22423
22434
|
const nodes = [];
|
|
22424
|
-
|
|
22425
|
-
|
|
22426
|
-
if (
|
|
22427
|
-
nodes.push(makeTextNode(
|
|
22428
|
-
|
|
22435
|
+
let pendingText = "";
|
|
22436
|
+
const flushText = () => {
|
|
22437
|
+
if (pendingText === "") return;
|
|
22438
|
+
nodes.push(makeTextNode(pendingText, format));
|
|
22439
|
+
pendingText = "";
|
|
22440
|
+
};
|
|
22441
|
+
for (const child of element.childNodes) if (child.nodeType === 3) pendingText += child.textContent ?? "";
|
|
22442
|
+
else if (child.nodeType === 1) {
|
|
22443
|
+
flushText();
|
|
22429
22444
|
const parsed = parseElement(child, registry, ctx, format);
|
|
22430
22445
|
if (parsed) if (Array.isArray(parsed)) nodes.push(...parsed);
|
|
22431
22446
|
else nodes.push(parsed);
|
|
22432
22447
|
}
|
|
22448
|
+
flushText();
|
|
22433
22449
|
return nodes;
|
|
22434
22450
|
}
|
|
22435
22451
|
function parseFallbackNode(element) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-litexml-cli",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.7",
|
|
4
4
|
"description": "Unified CLI for haklex LiteXML: convert LiteXML or Lexical JSON to HTML, JSON, or Markdown.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@lexical/headless": "^0.44.0",
|
|
20
20
|
"lexical": "^0.44.0",
|
|
21
|
-
"@haklex/rich-litexml": "0.15.
|
|
22
|
-
"@haklex/rich-
|
|
23
|
-
"@haklex/rich-
|
|
21
|
+
"@haklex/rich-litexml": "0.15.7",
|
|
22
|
+
"@haklex/rich-headless": "0.15.7",
|
|
23
|
+
"@haklex/rich-compose": "0.15.7"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "25.6.0",
|