@owomark/processor 0.1.7 → 0.1.8
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/.build-manifest.json +3 -3
- package/dist/index.js +19 -6
- package/package.json +2 -2
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"packageName": "@owomark/processor",
|
|
4
4
|
"packagePath": "owomark/packages/owomark-processor",
|
|
5
|
-
"packageFingerprint": "
|
|
6
|
-
"workspaceFingerprint": "
|
|
7
|
-
"builtAt": "2026-04-
|
|
5
|
+
"packageFingerprint": "7da289c40f30c980810832219951ddd7623f621d0defd2f6eb3fa8e03d20f211",
|
|
6
|
+
"workspaceFingerprint": "947c542dce3fedf4a242f46f580a35ff336c5a64ac6448d24339650ad9dac6a1",
|
|
7
|
+
"builtAt": "2026-04-23T10:30:21.564Z",
|
|
8
8
|
"builderVersion": "2026-04-22-industrialization-v1",
|
|
9
9
|
"inputFiles": [
|
|
10
10
|
"owomark/package.json",
|
package/dist/index.js
CHANGED
|
@@ -2960,6 +2960,8 @@ function inlineToMdast(nodes, options) {
|
|
|
2960
2960
|
switch (node.kind) {
|
|
2961
2961
|
case "text":
|
|
2962
2962
|
return options.enableMath === false ? [{ type: "text", value: node.text }] : splitMixedDoubleDollarText(node.text);
|
|
2963
|
+
case "softBreak":
|
|
2964
|
+
return options.preserveSoftLineBreaks === false ? [{ type: "break" }] : [{ type: "text", value: "\n" }];
|
|
2963
2965
|
case "strong":
|
|
2964
2966
|
return [{ type: "strong", children: inlineToMdast(node.children, options) }];
|
|
2965
2967
|
case "emphasis":
|
|
@@ -3312,16 +3314,26 @@ function buildRootFromBlocks(blocks, options) {
|
|
|
3312
3314
|
function buildRootFromDocument(document, options = {}) {
|
|
3313
3315
|
const conformanceBlocks = [...document.conformance.blocks];
|
|
3314
3316
|
function shiftConformanceForBlock(block) {
|
|
3315
|
-
if (block.type === "side-annotation" || block.type === "side-note-definition" || block.type === "directive-container" || block.type === "custom-block" || block.type === "reference-definition") {
|
|
3317
|
+
if (block.type === "side-annotation" || block.type === "side-note-definition" || block.type === "directive-container" || block.type === "custom-block" || block.type === "reference-definition" || block.type === "paragraph" && block.raw.trim() === "") {
|
|
3316
3318
|
return null;
|
|
3317
3319
|
}
|
|
3318
3320
|
return conformanceBlocks.shift() ?? null;
|
|
3319
3321
|
}
|
|
3320
|
-
const enrichedBlocks =
|
|
3322
|
+
const enrichedBlocks = [];
|
|
3323
|
+
for (let index = 0; index < document.blocks.length; index += 1) {
|
|
3324
|
+
const block = document.blocks[index];
|
|
3321
3325
|
const conformance = shiftConformanceForBlock(block);
|
|
3322
|
-
|
|
3326
|
+
const sourceBlockCount = conformance?.kind === "paragraph" || conformance?.kind === "blockquote" ? conformance.sourceBlockCount ?? 1 : 1;
|
|
3327
|
+
const sourceBlocks = document.blocks.slice(index, index + sourceBlockCount);
|
|
3328
|
+
const mergedRaw = sourceBlocks.map((entry) => entry.raw).join("\n");
|
|
3329
|
+
const mergedSyntaxRaw = sourceBlocks.map((entry) => entry.syntaxRaw).join("\n");
|
|
3330
|
+
const mergedEndLine = sourceBlocks[sourceBlocks.length - 1]?.endLine ?? block.endLine;
|
|
3331
|
+
enrichedBlocks.push({
|
|
3323
3332
|
...block,
|
|
3324
|
-
|
|
3333
|
+
raw: mergedRaw,
|
|
3334
|
+
syntaxRaw: mergedSyntaxRaw,
|
|
3335
|
+
endLine: mergedEndLine,
|
|
3336
|
+
conformanceInline: conformance?.kind === "paragraph" || conformance?.kind === "heading" || conformance?.kind === "blockquote" || conformance?.kind === "listItem" ? conformance.inline : void 0,
|
|
3325
3337
|
conformanceTableNode: conformance?.kind === "table" ? (position) => ({
|
|
3326
3338
|
type: "table",
|
|
3327
3339
|
children: conformance.rows.map((row) => ({
|
|
@@ -3333,8 +3345,9 @@ function buildRootFromDocument(document, options = {}) {
|
|
|
3333
3345
|
})),
|
|
3334
3346
|
position
|
|
3335
3347
|
}) : null
|
|
3336
|
-
};
|
|
3337
|
-
|
|
3348
|
+
});
|
|
3349
|
+
index += sourceBlockCount - 1;
|
|
3350
|
+
}
|
|
3338
3351
|
return buildRootFromBlocks(enrichedBlocks, options);
|
|
3339
3352
|
}
|
|
3340
3353
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owomark/processor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Node-safe Markdown and MDX processor, plugins, and built-in MDX components for OwoMark.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@owomark/core": "^0.1.
|
|
41
|
+
"@owomark/core": "^0.1.8",
|
|
42
42
|
"rehype-katex": "^6.0.3",
|
|
43
43
|
"rehype-pretty-code": "^0.14.1",
|
|
44
44
|
"rehype-slug": "^6.0.0",
|