mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
* fix #3184: Inject xlink in mermaidAPI. * fix static analysis
This commit is contained in:
parent
1509ee68be
commit
5b15865d30
2
.github/workflows/checks.yml
vendored
2
.github/workflows/checks.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: check tests
|
name: check tests
|
||||||
if: github.repository_owner == 'mermaid'
|
if: github.repository_owner == 'mermaid-js'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
@ -338,7 +338,6 @@ export const draw = function (text, id) {
|
|||||||
? select(sandboxElement.nodes()[0].contentDocument.body)
|
? select(sandboxElement.nodes()[0].contentDocument.body)
|
||||||
: select('body');
|
: select('body');
|
||||||
const svg = root.select(`[id="${id}"]`);
|
const svg = root.select(`[id="${id}"]`);
|
||||||
svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
|
||||||
|
|
||||||
// Run the renderer. This is what draws the final graph.
|
// Run the renderer. This is what draws the final graph.
|
||||||
const element = root.select('#' + id + ' g');
|
const element = root.select('#' + id + ' g');
|
||||||
|
@ -181,7 +181,6 @@ export const draw = function (text, id) {
|
|||||||
|
|
||||||
// Fetch the default direction, use TD if none was found
|
// Fetch the default direction, use TD if none was found
|
||||||
const diagram = root.select(`[id='${id}']`);
|
const diagram = root.select(`[id='${id}']`);
|
||||||
diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
|
||||||
insertMarkers(diagram);
|
insertMarkers(diagram);
|
||||||
|
|
||||||
// Layout graph, Create a new directed graph
|
// Layout graph, Create a new directed graph
|
||||||
|
@ -443,7 +443,6 @@ export const draw = function (text, id) {
|
|||||||
|
|
||||||
// Set up an SVG group so that we can translate the final graph.
|
// Set up an SVG group so that we can translate the final graph.
|
||||||
const svg = root.select(`[id="${id}"]`);
|
const svg = root.select(`[id="${id}"]`);
|
||||||
svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
|
||||||
|
|
||||||
// Adds title and description to the flow chart
|
// Adds title and description to the flow chart
|
||||||
addSVGAccessibilityFields(parser.yy, svg, id);
|
addSVGAccessibilityFields(parser.yy, svg, id);
|
||||||
|
@ -425,7 +425,6 @@ export const draw = function (text, id) {
|
|||||||
|
|
||||||
// Set up an SVG group so that we can translate the final graph.
|
// Set up an SVG group so that we can translate the final graph.
|
||||||
const svg = root.select(`[id="${id}"]`);
|
const svg = root.select(`[id="${id}"]`);
|
||||||
svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
|
||||||
|
|
||||||
// Adds title and description to the flow chart
|
// Adds title and description to the flow chart
|
||||||
addSVGAccessibilityFields(parser.yy, svg, id);
|
addSVGAccessibilityFields(parser.yy, svg, id);
|
||||||
|
@ -69,7 +69,6 @@ export const draw = function (text, id) {
|
|||||||
|
|
||||||
bounds.init();
|
bounds.init();
|
||||||
const diagram = root.select('#' + id);
|
const diagram = root.select('#' + id);
|
||||||
diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
|
||||||
|
|
||||||
svgDraw.initGraphics(diagram);
|
svgDraw.initGraphics(diagram);
|
||||||
|
|
||||||
|
@ -313,6 +313,7 @@ const render = function (id, _txt, cb, container) {
|
|||||||
.attr('id', id)
|
.attr('id', id)
|
||||||
.attr('width', '100%')
|
.attr('width', '100%')
|
||||||
.attr('xmlns', 'http://www.w3.org/2000/svg')
|
.attr('xmlns', 'http://www.w3.org/2000/svg')
|
||||||
|
.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink')
|
||||||
.append('g');
|
.append('g');
|
||||||
} else {
|
} else {
|
||||||
// No container was provided
|
// No container was provided
|
||||||
|
Loading…
x
Reference in New Issue
Block a user