mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-19 12:14:07 +01:00
Fix for issue #311, mermaid will clear div used for rendering initially in the redner function.
This commit is contained in:
@@ -346,8 +346,6 @@ exports.decodeEntities = function(text){
|
||||
return ';';
|
||||
});
|
||||
|
||||
|
||||
|
||||
return txt;
|
||||
};
|
||||
/**
|
||||
@@ -376,6 +374,8 @@ exports.decodeEntities = function(text){
|
||||
var render = function(id, txt, cb, container){
|
||||
|
||||
if(typeof container !== 'undefined'){
|
||||
container.innerHTML = '';
|
||||
|
||||
d3.select(container).append('div')
|
||||
.attr('id', 'd'+id)
|
||||
.append('svg')
|
||||
@@ -385,6 +385,11 @@ var render = function(id, txt, cb, container){
|
||||
.append('g');
|
||||
}
|
||||
else{
|
||||
var element = document.querySelector('#' + 'd'+id);
|
||||
if(element){
|
||||
element.innerHTML = '';
|
||||
}
|
||||
|
||||
d3.select('body').append('div')
|
||||
.attr('id', 'd'+id)
|
||||
.append('svg')
|
||||
|
||||
Reference in New Issue
Block a user