Skip to content

Commit

Permalink
Added check for previously processed div elements, fix for issue #29,…
Browse files Browse the repository at this point in the history
… thank to user madebits for fix.
  • Loading branch information
knsv committed Dec 3, 2014
1 parent 0539b8a commit 52a7837
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 49 deletions.
50 changes: 28 additions & 22 deletions dist/mermaid.full.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/mermaid.full.min.js

Large diffs are not rendered by default.

50 changes: 28 additions & 22 deletions dist/mermaid.slim.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/mermaid.slim.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@ var init = function () {
var cnt = 0;
for (i = 0; i < arr.length; i++) {
var element = arr[i];

// Check if previously processed
if(!element.getAttribute("data-processed")) {
element.setAttribute("data-processed", true);
} else continue;

var id;

id = 'mermaidChart' + cnt;
Expand Down
2 changes: 1 addition & 1 deletion test/web.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">

<script src="browserifyUsage.js"></script>
<script src="../dist/mermaid.full.js"></script>
<script>
var mermaid_config = {
startOnLoad:true
Expand Down

0 comments on commit 52a7837

Please sign in to comment.