feat(excalidraw): support .excalidraw.md (Obsidian plugin format) with lz-string decompression
CI / lint (push) Failing after 14s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 13s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
CI / lint (push) Failing after 14s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 13s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
This commit is contained in:
@@ -75,13 +75,14 @@ export function renderExcalidraw(container, data, vaultName, filePath, opts = {}
|
||||
case 'ready':
|
||||
// Iframe is mounted — send initial data
|
||||
editorState.ready = true;
|
||||
// Support both pure .excalidraw and compressed .excalidraw.md
|
||||
const initData = data.excalidraw_data || {};
|
||||
if (data.excalidraw_data_compressed) {
|
||||
initData.compressed = data.excalidraw_data_compressed;
|
||||
}
|
||||
iframe.contentWindow.postMessage({
|
||||
type: 'init',
|
||||
data: data.excalidraw_data || {
|
||||
elements: [],
|
||||
appState: { viewBackgroundColor: '#ffffff' },
|
||||
files: {},
|
||||
},
|
||||
data: initData,
|
||||
theme: theme,
|
||||
}, '*');
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user