Skip to content

Commit

Permalink
Merge pull request #839 from obgnail/dev
Browse files Browse the repository at this point in the history
thirdPartyDiagramParser.
  • Loading branch information
obgnail authored Nov 9, 2024
2 parents ff3c323 + 0748bdc commit ab544ad
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugin/global/core/utils/mixin/thirdPartyDiagramParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class thirdPartyDiagramParser {
this.defaultHeight = "230px";
this.defaultBackgroundColor = "#F8F8F8";
this.regexp = /^\/\/{height:"(?<height>.*?)",width:"(?<width>.*?)"}/;
this.getPanelWidth = this.utils.cache($pre => parseFloat($pre.find(".md-diagram-panel").css("width")) - 10 + "px");
}

/**
Expand Down Expand Up @@ -138,7 +137,7 @@ class thirdPartyDiagramParser {
const customCss = parser.css instanceof Function ? parser.css($pre, $wrap, content) : parser.css;
const { height: h, width: w, "background-color": bgc, ...args } = customCss || {};
$wrap.css({
width: width || w || this.getPanelWidth($pre),
width: width || w || parseFloat($pre.find(".md-diagram-panel").css("width")) - 10 + "px",
height: height || h || this.defaultHeight,
"background-color": bgc || this.defaultBackgroundColor,
...args,
Expand Down

0 comments on commit ab544ad

Please sign in to comment.