Skip to content

Commit

Permalink
File saving doesn't work #2
Browse files Browse the repository at this point in the history
  • Loading branch information
NeVeSpl committed Apr 21, 2023
1 parent ca406ea commit 4f24722
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions MermaidEditor/LivePreview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@
})
}

async function getPNG(save = true) {
export async function getPNG(save = true)
{
console.log(`getPNG(${save})`);

var svgElem = document.querySelector('svg');
var canvas = document.querySelector('canvas');
var ctx = canvas.getContext("2d");
Expand All @@ -164,12 +167,13 @@

await drawInlineSVG(svgElem, ctx);
var img = canvas.toDataURL("image/png");
//console.log(img);
console.log(img);
if (save) {
sendMessage(img);
}
return img;
}
window.getPNG = getPNG;

mermaid.parseError = (error, hash) => {
console.log("mermaid.parseError \r\n");
Expand Down
4 changes: 2 additions & 2 deletions MermaidEditor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("10.1.0.0")]
[assembly: AssemblyFileVersion("10.1.0.0")]
[assembly: AssemblyVersion("10.1.0.1")]
[assembly: AssemblyFileVersion("10.1.0.1")]
2 changes: 1 addition & 1 deletion MermaidEditor/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Mermaid.EditorForVisualStudio.e5c82390-1fc1-4d02-8b2d-d732b369ffc6" Version="10.1.0.0" Language="en-US" Publisher="NeVeS" />
<Identity Id="Mermaid.EditorForVisualStudio.e5c82390-1fc1-4d02-8b2d-d732b369ffc6" Version="10.1.0.1" Language="en-US" Publisher="NeVeS" />
<DisplayName>Mermaid editor for Visual Studio</DisplayName>
<Description xml:space="preserve">A very simple editor for Mermaid files(*.mmd, *.mermaid). It offers live preview, syntax highlighting and generates diagrams in *.svg and *.png formats.</Description>
<MoreInfo>https://github.com/NeVeSpl/MermaidEditorForVisualStudio</MoreInfo>
Expand Down

0 comments on commit 4f24722

Please sign in to comment.