mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-04 22:59:50 +02:00
1169- break out getRows
Moved getRows function from `state/stateRenderer.js` and `state/shapes.js` into `common/common.js`. Broke out section into small one line functions for replacing line breaks, then moved the `sanitize` function from `utils.js` to this new module as there is shared functionality
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as d3 from 'd3';
|
||||
import { logger } from '../../logger';
|
||||
import { getConfig } from '../../config';
|
||||
import common from '../common/common';
|
||||
import utils from '../../utils';
|
||||
|
||||
const MERMAID_DOM_ID_PREFIX = 'classid-';
|
||||
@@ -175,7 +176,7 @@ export const setLink = function(ids, linkStr, tooltip) {
|
||||
classes[id].link = utils.formatUrl(linkStr, config);
|
||||
|
||||
if (tooltip) {
|
||||
classes[id].tooltip = utils.sanitize(tooltip, config);
|
||||
classes[id].tooltip = common.sanitizeText(tooltip, config);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -207,7 +208,7 @@ const setClickFunc = function(domId, functionName, tooltip) {
|
||||
}
|
||||
if (typeof classes[id] !== 'undefined') {
|
||||
if (tooltip) {
|
||||
classes[id].tooltip = utils.sanitize(tooltip, config);
|
||||
classes[id].tooltip = common.sanitizeText(tooltip, config);
|
||||
}
|
||||
|
||||
funs.push(function() {
|
||||
|
Reference in New Issue
Block a user