This commit is contained in:
Zsolt Viczian
2022-04-30 17:47:08 +02:00
parent 26e12e8cec
commit f0f65fb9a3
6 changed files with 22 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "1.6.25",
"version": "1.6.26",
"minAppVersion": "0.12.16",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",

View File

@@ -1,6 +1,6 @@
{
"name": "obsidian-excalidraw-plugin",
"version": "1.6.26-3",
"version": "1.6.26",
"description": "This is an Obsidian.md plugin that lets you view and edit Excalidraw drawings",
"main": "lib/index.js",
"types": "lib/index.d.ts",

View File

@@ -391,7 +391,8 @@ const convertMarkdownToSVG = async (
): Promise<DataURL> => {
//1.
//get the markdown text
let text = (await getTransclusion(linkParts, plugin.app, file)).contents;
const transclusion = await getTransclusion(linkParts, plugin.app, file);
let text = (transclusion.leadingHashes??"") + transclusion.contents;
if (text === "") {
text =
"# Empty markdown file\nCTRL+Click here to open the file for editing in the current active pane, or CTRL+SHIFT+Click to open it in an adjacent pane.";

View File

@@ -1414,7 +1414,7 @@ export const getTransclusion = async (
app: App,
file: TFile,
charCountLimit?: number,
): Promise<{ contents: string; lineNum: number }> => {
): Promise<{ contents: string; lineNum: number; leadingHashes?: string; }> => {
//file-name#^blockref
//1 2 3
@@ -1473,11 +1473,16 @@ export const getTransclusion = async (
let j = i;
while (j<headings.length && headings[j].node.depth>depth) {j++};
if(j === headings.length && headings[j-1].node.depth > depth) {
return { contents: "#".repeat(depth)+" "+contents.substring(startPos).trim(), lineNum };
return {
leadingHashes: "#".repeat(depth)+" ",
contents: contents.substring(startPos).trim(),
lineNum
};
}
endPos = headings[i].node.position.start.offset - 1;
return {
contents: "#".repeat(depth)+" "+contents.substring(startPos, endPos).trim(),
leadingHashes: "#".repeat(depth)+" ",
contents: contents.substring(startPos, endPos).trim(),
lineNum,
};
}
@@ -1499,7 +1504,11 @@ export const getTransclusion = async (
}
}
if (startPos) {
return { contents: "#".repeat(depth)+" "+contents.substring(startPos).trim(), lineNum };
return {
leadingHashes: "#".repeat(depth) + " ",
contents: contents.substring(startPos).trim(),
lineNum
};
}
return { contents: linkParts.original.trim(), lineNum: 0 };
};

View File

@@ -25,15 +25,15 @@ I develop this plugin as a hobby, spending most of my free time doing this. If y
- Dropped images and links were not selectable with the selection tool until the file was saved. This is now fixed.
- Display the linked block/section on link-hover instead of the full page. [#597](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/597)
- Hover preview without CTRL/CMD works again. Requires configuration in plugin settings. [#595](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/595)
- If you embed the same markdown document into a drawing multiple times, you can now display different sections of the documents in each embedded object. [#601](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/601).
- If you embed the same markdown document into a drawing multiple times, you can now display different sections of the document in each embedded object. [#601](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/601).
- If you make a copy of an equation and edit this copy, the original equation will remain unchanged [#593](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/593)
## New Features
- When you drag files from dataview results onto the canvas the obsidian urls will be converted into wiki links.[#599](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/599)
- I added one more frontmatter key: ${String.fromCharCode(96)}excalidraw-linkbutton-opacity: 0.5${String.fromCharCode(96)}. This sets the opacity of the blue link-button in the top right corner of the element, overriding the respective setting in plugin settings. Valid values are numbers between 0 and 1, where 0 means the button is fully transparent.
- When you drag files from Dataview-results onto the canvas the obsidian:// urls will be converted into wiki links.[#599](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/599)
- I added one more frontmatter key: ${String.fromCharCode(96)}excalidraw-linkbutton-opacity: ${String.fromCharCode(96)} This sets the opacity of the blue link-button in the top right corner of the element, overriding the respective setting in plugin settings. Valid values are numbers between 0 and 1, where 0 means the button is fully transparent.
## New Excalidraw Automate Features
- As part of building the new ExcaliBrain plugin, I've added a number of integration features. See the GitHub [Release Notes](https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/1.6.26) for details.
- As part of building the new [ExcaliBrain](https://youtu.be/O2s-h5VKCas) plugin, I've added a number of integration features. See the GitHub [Release Notes](https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/1.6.26) for details.
`,
"1.6.25": `
## Fixed

View File

@@ -1,4 +1,4 @@
{
"1.6.25": "0.12.16",
"1.6.26": "0.12.16",
"1.4.2": "0.11.13"
}