Skip to content

Commit 9ca68d0

Browse files
Fixed frontmatter order not preserved
1 parent d746f26 commit 9ca68d0

File tree

4 files changed

+2
-255
lines changed

4 files changed

+2
-255
lines changed

package-lock.json

Lines changed: 0 additions & 232 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"esbuild-plugin-copy": "^2.1.1",
1919
"esbuild-sass-plugin": "^3.3.1",
2020
"html-to-image": "^1.11.11",
21-
"json-stable-stringify": "^1.2.1",
2221
"monkey-around": "^2.3.0",
2322
"sass": "^1.70.0",
2423
"tiny-jsonc": "^1.0.1"

src/patchers/canvas-patcher.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { EditorView, ViewUpdate } from "@codemirror/view"
2-
import JSONSS from "json-stable-stringify"
32
import { around } from "monkey-around"
43
import { editorInfoField, requireApiVersion, Side, WorkspaceLeaf } from "obsidian"
54
import { BBox, Canvas, CanvasEdge, CanvasElement, CanvasNode, CanvasPopupMenu, CanvasView, NodeInteractionLayer, Position, SelectionData } from "src/@types/Canvas"
@@ -100,25 +99,6 @@ export default class CanvasPatcher extends Patcher {
10099
that.plugin.app.workspace.trigger('advanced-canvas:canvas-changed', this.canvas)
101100
return result
102101
}),
103-
getViewData: Patcher.OverrideExisting(next => function (...args: any): string {
104-
const canvasData = this.canvas.getData()
105-
106-
try {
107-
const stringified = JSONSS(canvasData, { space: 2 })
108-
if (stringified === undefined) throw new Error('Failed to stringify canvas data using json-stable-stringify')
109-
110-
return stringified
111-
} catch (e) {
112-
console.error('Failed to stringify canvas data using json-stable-stringify:', e)
113-
114-
try {
115-
return JSON.stringify(canvasData, null, 2)
116-
} catch (e) {
117-
console.error('Failed to stringify canvas data using JSON.stringify:', e)
118-
return next.call(this, ...args)
119-
}
120-
}
121-
}),
122102
close: Patcher.OverrideExisting(next => function (...args: any): void {
123103
that.plugin.app.workspace.trigger('advanced-canvas:canvas-view-unloaded:before', this)
124104
return next.call(this, ...args)

src/utils/filepath-helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default class FilepathHelper {
2-
static extension(path: string): string | undefined {
3-
return path.includes('.') ? path.split('.').pop() : undefined
2+
static extension(path: string | undefined): string | undefined {
3+
return path?.includes('.') ? path?.split('.')?.pop() : undefined
44
}
55
}

0 commit comments

Comments
 (0)