@ones-editor/editor 1.0.2-beta.17 → 1.0.2-beta.18
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 +28 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23466,9 +23466,10 @@ var __publicField = (obj, key, value) => {
|
|
|
23466
23466
|
for (let i = 0; i < blocks.length; i++) {
|
|
23467
23467
|
if (i === 0) {
|
|
23468
23468
|
const currentBlock = editor.getBlockByIndex(containerId, blockIndex2);
|
|
23469
|
-
|
|
23469
|
+
const isTextKindInsert = blocks[i].type === "text" || blocks[i].type === "list";
|
|
23470
|
+
if (currentBlock && isTextKindBlock(editor, currentBlock) && isEmptyTextBlock(editor, currentBlock) && isTextKindInsert) {
|
|
23470
23471
|
editor.insertTextToBlock(block, 0, (_a = blocks[i].text) != null ? _a : []);
|
|
23471
|
-
if (Object.
|
|
23472
|
+
if (Object.keys(blocks[i]).length > 3) {
|
|
23472
23473
|
editor.updateBlockData(currentBlock, blocks[i]);
|
|
23473
23474
|
}
|
|
23474
23475
|
continue;
|
|
@@ -25375,7 +25376,30 @@ var __publicField = (obj, key, value) => {
|
|
|
25375
25376
|
addMetaToDoc(editor, doc2);
|
|
25376
25377
|
const htmlFragment = docToHtmlFragment(editor, doc2);
|
|
25377
25378
|
const html = injectDocToHtmlFragment(htmlFragment, doc2);
|
|
25378
|
-
|
|
25379
|
+
let markdown = "";
|
|
25380
|
+
const lines = [];
|
|
25381
|
+
let hasCodeBlock = false;
|
|
25382
|
+
doc2.blocks.root.forEach((b, index2) => {
|
|
25383
|
+
const parentContainer = editor.getParentContainer(editor.getBlockById(b.id));
|
|
25384
|
+
const parentBlock = getParentBlock(parentContainer);
|
|
25385
|
+
const isCodeTextBlock2 = parentBlock && getBlockType(parentBlock) === "code";
|
|
25386
|
+
if (isCodeTextBlock2) {
|
|
25387
|
+
if (!hasCodeBlock) {
|
|
25388
|
+
const codeBlock2 = parentBlock;
|
|
25389
|
+
const codeBlockData = editor.getBlockData(codeBlock2);
|
|
25390
|
+
const codeText = editor.getSelectedText();
|
|
25391
|
+
lines.push(`\`\`\`${codeBlockData.language}
|
|
25392
|
+
${codeText}
|
|
25393
|
+
\`\`\`
|
|
25394
|
+
`);
|
|
25395
|
+
hasCodeBlock = true;
|
|
25396
|
+
}
|
|
25397
|
+
} else {
|
|
25398
|
+
lines.push(blockToMarkdown(editor, b, doc2, [{ containerId: "root", blockIndex: index2 }]));
|
|
25399
|
+
}
|
|
25400
|
+
});
|
|
25401
|
+
lines[lines.length - 1] = lines[lines.length - 1].trimEnd();
|
|
25402
|
+
markdown = lines.join("\n");
|
|
25379
25403
|
const blob = new Blob([html], {
|
|
25380
25404
|
type: "text/html"
|
|
25381
25405
|
});
|
|
@@ -42798,7 +42822,7 @@ var __publicField = (obj, key, value) => {
|
|
|
42798
42822
|
}
|
|
42799
42823
|
function updateMarker(marker, listData) {
|
|
42800
42824
|
const type = getListType(listData);
|
|
42801
|
-
if (type === "text-only"
|
|
42825
|
+
if (type === "text-only") {
|
|
42802
42826
|
return;
|
|
42803
42827
|
}
|
|
42804
42828
|
if (type === "checked") {
|