@tnotesjs/core 0.6.0 → 0.6.1
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.
|
@@ -78,7 +78,7 @@ function normalizeHeadings(lines) {
|
|
|
78
78
|
const match = line.match(/^(#{2,6})\s+(.+?)\s*#*\s*$/);
|
|
79
79
|
if (!match) continue;
|
|
80
80
|
const level = match[1].length;
|
|
81
|
-
const plainText = match[2].replace(/^\d+(?:\.\d+)
|
|
81
|
+
const plainText = match[2].replace(/^\d+(?:\.\d+)+\.?\s+|^\d+\.\s+/, "").trim();
|
|
82
82
|
let text = plainText;
|
|
83
83
|
if (level === 2) {
|
|
84
84
|
counters.h2 += 1;
|
|
@@ -78,7 +78,7 @@ function normalizeHeadings(lines) {
|
|
|
78
78
|
const match = line.match(/^(#{2,6})\s+(.+?)\s*#*\s*$/);
|
|
79
79
|
if (!match) continue;
|
|
80
80
|
const level = match[1].length;
|
|
81
|
-
const plainText = match[2].replace(/^\d+(?:\.\d+)
|
|
81
|
+
const plainText = match[2].replace(/^\d+(?:\.\d+)+\.?\s+|^\d+\.\s+/, "").trim();
|
|
82
82
|
let text = plainText;
|
|
83
83
|
if (level === 2) {
|
|
84
84
|
counters.h2 += 1;
|
package/dist/markdown/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk5F5RJ2HVcjs = require('../chunk-5F5RJ2HV.cjs');
|
|
6
6
|
require('../chunk-HXED7KVT.cjs');
|
|
7
7
|
|
|
8
8
|
// markdown/components.ts
|
|
@@ -79,4 +79,4 @@ function findTNotesComponent(name) {
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
exports.NOTE_TOC_END_TAG =
|
|
82
|
+
exports.NOTE_TOC_END_TAG = _chunk5F5RJ2HVcjs.NOTE_TOC_END_TAG; exports.NOTE_TOC_START_TAG = _chunk5F5RJ2HVcjs.NOTE_TOC_START_TAG; exports.TNOTES_COMPONENTS = TNOTES_COMPONENTS; exports.findTNotesComponent = findTNotesComponent; exports.formatTNotesNote = _chunk5F5RJ2HVcjs.formatTNotesNote;
|
package/dist/markdown/index.js
CHANGED
package/dist/workspace/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk5F5RJ2HVcjs = require('../chunk-5F5RJ2HV.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -706,7 +706,7 @@ var Workspace = class {
|
|
|
706
706
|
const config = requireConfig(snapshot);
|
|
707
707
|
const note = findNote(snapshot, input.noteUuid);
|
|
708
708
|
assertRevision(note.revision, input.expectedRevision, "\u7B14\u8BB0");
|
|
709
|
-
const formatted = await
|
|
709
|
+
const formatted = await _chunk5F5RJ2HVcjs.formatTNotesNote.call(void 0, {
|
|
710
710
|
content: input.content,
|
|
711
711
|
noteIndex: note.index,
|
|
712
712
|
title: note.title,
|
|
@@ -763,7 +763,7 @@ var Workspace = class {
|
|
|
763
763
|
};
|
|
764
764
|
const readmePath = _path2.default.join(directoryPath, "README.md");
|
|
765
765
|
const configPath = _path2.default.join(directoryPath, ".tnotes.json");
|
|
766
|
-
const formatted = await
|
|
766
|
+
const formatted = await _chunk5F5RJ2HVcjs.formatTNotesNote.call(void 0, {
|
|
767
767
|
content: _chunk3R7QSABBcjs.getNewNoteReadmeBody.call(void 0, ),
|
|
768
768
|
noteIndex: index,
|
|
769
769
|
title,
|
|
@@ -845,7 +845,7 @@ var Workspace = class {
|
|
|
845
845
|
if (error instanceof WorkspaceError) throw error;
|
|
846
846
|
}
|
|
847
847
|
const currentContent = await _promises2.default.readFile(note.readmePath, "utf8");
|
|
848
|
-
const formatted = await
|
|
848
|
+
const formatted = await _chunk5F5RJ2HVcjs.formatTNotesNote.call(void 0, {
|
|
849
849
|
content: currentContent,
|
|
850
850
|
noteIndex: note.index,
|
|
851
851
|
title,
|
package/dist/workspace/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tnotesjs/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "TNotes 知识库核心框架 —— 基于 VitePress 的笔记管理系统",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.17.1",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"vue": "^3.5.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@tnotesjs/mindmap-core": "^0.2.
|
|
64
|
+
"@tnotesjs/mindmap-core": "^0.2.1",
|
|
65
65
|
"echarts": "^6.0.0",
|
|
66
66
|
"github-slugger": "^2.0.0",
|
|
67
67
|
"markdown-it-container": "^4.0.0",
|