mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
2.9.0-beta-1, 0.18.0-1, fixed group references in live preview due to Obsidian 1.8.9 language changes
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-excalidraw-plugin",
|
||||
"name": "Excalidraw",
|
||||
"version": "2.8.3",
|
||||
"version": "2.9.0-beta-1",
|
||||
"minAppVersion": "1.1.6",
|
||||
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
|
||||
"author": "Zsolt Viczian",
|
||||
|
||||
@@ -802,10 +802,14 @@ const tmpObsidianWYSIWYG = async (
|
||||
el.empty();
|
||||
} else {
|
||||
//Obsidian changed this at some point from h3 to h5 and also the text...
|
||||
const warningEl = el.querySelector("div>*[data-heading^='Unable to find ");
|
||||
let warningEl = el.querySelector("div>*[data-heading^='Unable to find ");
|
||||
if(!warningEl) {
|
||||
//changed in Obsidian 1.8.9
|
||||
warningEl = el.querySelector("div > *[data-heading]");
|
||||
}
|
||||
if(warningEl) {
|
||||
const dataHeading = warningEl.getAttr("data-heading");
|
||||
const ref = warningEl.getAttr("data-heading").match(/Unable to find[^^]+(\^(?:group=|area=|frame=|clippedframe=)[^ ”]+)/)?.[1];
|
||||
const ref = dataHeading.match(/.+(\^(?:group=|area=|frame=|clippedframe=)[A-Za-z0-9_-]{8,21})/)?.[1];
|
||||
if(ref) {
|
||||
attr.fname = file.path + "#" +ref;
|
||||
areaPreview = true;
|
||||
@@ -926,7 +930,7 @@ export const markdownPostProcessor = async (
|
||||
if(docIDs.has(ctx.docId) && !el.hasChildNodes()) {
|
||||
docIDs.delete(ctx.docId);
|
||||
}
|
||||
const isAreaGroupFrameRef = el.querySelectorAll('[data-heading^="Unable to find"]').length === 1;
|
||||
const isAreaGroupFrameRef = el.querySelectorAll('div > *[data-heading]').length === 1;
|
||||
if(!isAreaGroupFrameRef) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user