mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-12-09 14:04:14 +01:00
Added support for entity codes so that it for instance is possible to represent a " with #quot; and a heart with #9829; This differs from the regular html codes in that the leading & isreplaced with a dsh and for dec codes dropped. This as referenced in issue #219.
This commit is contained in:
29
dist/mermaid.js
vendored
29
dist/mermaid.js
vendored
@@ -32727,11 +32727,10 @@ var setupToolTips = function(element){
|
||||
|
||||
tooltipElem.transition()
|
||||
.duration(200)
|
||||
.style("opacity", .9);
|
||||
.style("opacity", '.9');
|
||||
tooltipElem.html(el.attr('title'))
|
||||
.style("left", (rect.left+(rect.right-rect.left)/2) + "px")
|
||||
.style("top", (rect.top-14+document.body.scrollTop) + "px");
|
||||
var el = d3.select(this);
|
||||
el.classed('hover',true);
|
||||
|
||||
})
|
||||
@@ -37427,6 +37426,7 @@ exports.getNoteRect = function(){
|
||||
var mermaidAPI = _dereq_('./mermaidAPI');
|
||||
var nextId = 0;
|
||||
var log = _dereq_('./logger').create();
|
||||
var utils = _dereq_('./utils');
|
||||
|
||||
module.exports.mermaidAPI = mermaidAPI;
|
||||
/**
|
||||
@@ -37529,12 +37529,33 @@ var init = function () {
|
||||
txt = txt.replace(/>/g,'>');
|
||||
txt = txt.replace(/</g,'<');
|
||||
txt = he.decode(txt).trim();
|
||||
|
||||
txt = exports.encodeEntities(txt);
|
||||
if( utils.detectType(txt) === 'sequenceDiagram'){
|
||||
txt = he.decode(txt).trim();
|
||||
}
|
||||
mermaidAPI.render(id,txt,insertSvg, element);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
exports.encodeEntities = function(text){
|
||||
var txt = text;
|
||||
|
||||
txt = txt.replace(/#\w*;?/g,function(s,t,u){
|
||||
var innerTxt = s.substring(1,s.length-1);
|
||||
|
||||
var isInt = /^\+?\d+$/.test(innerTxt);
|
||||
if(isInt){
|
||||
return '&#'+innerTxt+';';
|
||||
}else{
|
||||
return '&'+innerTxt+';';
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return txt;
|
||||
};
|
||||
|
||||
exports.init = init;
|
||||
exports.parse = mermaidAPI.parse;
|
||||
/**
|
||||
@@ -37678,7 +37699,7 @@ if(typeof document !== 'undefined'){
|
||||
//}));
|
||||
|
||||
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../package.json":86,"./logger":104,"./mermaidAPI":105,"he":84}],104:[function(_dereq_,module,exports){
|
||||
},{"../package.json":86,"./logger":104,"./mermaidAPI":105,"./utils":106,"he":84}],104:[function(_dereq_,module,exports){
|
||||
(function (process){
|
||||
/**
|
||||
* #logger
|
||||
|
||||
Reference in New Issue
Block a user