@ones-editor/editor 2.1.7-beta.33 → 2.1.7-beta.34
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/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +12 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -73528,7 +73528,7 @@ ${content}
|
|
|
73528
73528
|
}
|
|
73529
73529
|
node.childNodes.forEach(replaceBrToTextNode);
|
|
73530
73530
|
}
|
|
73531
|
-
function textToCodeBlock(text2,
|
|
73531
|
+
function textToCodeBlock(text2, language) {
|
|
73532
73532
|
const codeBlocks = text2.split("\n").map((line) => {
|
|
73533
73533
|
const block = {
|
|
73534
73534
|
type: "text",
|
|
@@ -73543,7 +73543,7 @@ ${content}
|
|
|
73543
73543
|
root: [{
|
|
73544
73544
|
id: genId(),
|
|
73545
73545
|
type: "code",
|
|
73546
|
-
|
|
73546
|
+
language,
|
|
73547
73547
|
children: [containerId]
|
|
73548
73548
|
}],
|
|
73549
73549
|
[containerId]: codeBlocks
|
|
@@ -73618,8 +73618,15 @@ ${content}
|
|
|
73618
73618
|
return node.nodeName === "PRE" && ((_a = node.firstChild) == null ? void 0 : _a.nodeName) === "CODE";
|
|
73619
73619
|
},
|
|
73620
73620
|
replacement: (content, node, options) => {
|
|
73621
|
+
var _a;
|
|
73621
73622
|
replaceBrToTextNode(node);
|
|
73622
|
-
|
|
73623
|
+
const classes = Array.from(((_a = node.firstElementChild) == null ? void 0 : _a.classList) || []);
|
|
73624
|
+
const langClass = classes.find((c) => c.startsWith("lang-"));
|
|
73625
|
+
let lang = "";
|
|
73626
|
+
if (langClass) {
|
|
73627
|
+
lang = langClass.substring("lang-".length);
|
|
73628
|
+
}
|
|
73629
|
+
return "\n\n" + options.fence + "\n" + nodeToCodeBlock(node, lang) + "\n" + options.fence + "\n\n";
|
|
73623
73630
|
}
|
|
73624
73631
|
});
|
|
73625
73632
|
}
|
|
@@ -89259,7 +89266,7 @@ ${data2.flowchartText}
|
|
|
89259
89266
|
}
|
|
89260
89267
|
}
|
|
89261
89268
|
});
|
|
89262
|
-
editor.version = "2.1.7-beta.
|
|
89269
|
+
editor.version = "2.1.7-beta.34";
|
|
89263
89270
|
return editor;
|
|
89264
89271
|
}
|
|
89265
89272
|
function isDoc(doc2) {
|
|
@@ -89373,7 +89380,7 @@ ${data2.flowchartText}
|
|
|
89373
89380
|
}
|
|
89374
89381
|
}
|
|
89375
89382
|
OnesEditorToolbar.register(editor);
|
|
89376
|
-
editor.version = "2.1.7-beta.
|
|
89383
|
+
editor.version = "2.1.7-beta.34";
|
|
89377
89384
|
return editor;
|
|
89378
89385
|
}
|
|
89379
89386
|
async function showDocVersions(editor, options, serverUrl) {
|