Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mermaid #128

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ See the [change log](CHANGELOG.md) for changes and road map.
- Powered by [Markdig](https://github.com/lunet-io/markdig) - the best markdown parser
- Syntax highlighting
- Live preview window with scroll sync
- Mermaid chart support
- Custom preview template (with JavaScript) support
- CommonMark and GitHub flavored Markdown
- High-DPI support
- Drag 'n drop of images supported
Expand Down
7 changes: 1 addition & 6 deletions src/Margin/Browser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ await Control.Dispatcher.BeginInvoke(new Action(() =>

// Makes sure that any code blocks get syntax highlighted by Prism
var win = _htmlDocument.parentWindow;
try { win.execScript("Prism.highlightAll();", "javascript"); } catch { }
try { win.execScript("mermaid.init(undefined, document.querySelectorAll('.mermaid'));", "javascript"); } catch { }
try { win.execScript("if (typeof Prism == 'object') Prism.highlightAll();", "javascript"); } catch { }
try { win.execScript("if (typeof onMarkdownUpdate == 'function') onMarkdownUpdate();", "javascript"); } catch { }

// Adjust the anchors after and edit
Expand Down Expand Up @@ -339,24 +338,20 @@ private string GetHtmlTemplate()
var baseHref = Path.GetDirectoryName(_file).Replace("\\", "/");
string folder = GetFolder();
string cssHighlightPath = GetCustomStylesheet(_file) ?? Path.Combine(folder, "margin\\highlight.css");
string cssMermaidPath = Path.Combine(folder, "margin\\mermaid.css");
string scriptPrismPath = Path.Combine(folder, "margin\\prism.js");
string scriptMermaidPath = Path.Combine(folder, "margin\\mermaid.js");

var defaultHeadBeg = $@"
<head>
<meta http-equiv=""X-UA-Compatible"" content=""IE=Edge"" />
<meta charset=""utf-8"" />
<base href=""file:///{baseHref}/"" />
<link rel=""stylesheet"" href=""{cssHighlightPath}"" />
<link rel=""stylesheet"" href=""{cssMermaidPath}"" />
";
var defaultContent = $@"
<div id=""___markdown-content___"" class=""markdown-body"">
[content]
</div>
<script src=""{scriptPrismPath}""></script>
<script src=""{scriptMermaidPath}""></script>
";

var templateFileName = GetHtmlTemplateFileName(_file);
Expand Down
353 changes: 0 additions & 353 deletions src/Margin/mermaid.css

This file was deleted.

Loading