mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-16 13:59:54 +02:00
chore(katex): fixed issues from merge
This commit is contained in:
@@ -63,14 +63,7 @@ export const addVertices = function (vert, g, svgId, root, doc, diagObj) {
|
|||||||
if (evaluate(getConfig().flowchart.htmlLabels)) {
|
if (evaluate(getConfig().flowchart.htmlLabels)) {
|
||||||
// TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?
|
// TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?
|
||||||
const node = {
|
const node = {
|
||||||
label: vertexText
|
label: vertexText,
|
||||||
.replace(/fa[blrs]?:fa-[\w-]+/g, (s) => `<i class='${s.replace(':', ' ')}'></i>`)
|
|
||||||
.replace(/\$\$(.*)\$\$/g, (r, c) =>
|
|
||||||
katex
|
|
||||||
.renderToString(c, { throwOnError: true, displayMode: true, output: 'mathml' })
|
|
||||||
.replace(/\n/g, ' ')
|
|
||||||
.replace(/<annotation.*<\/annotation>/g, '')
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
vertexNode = addHtmlLabel(svg, node).node();
|
vertexNode = addHtmlLabel(svg, node).node();
|
||||||
vertexNode.parentNode.removeChild(vertexNode);
|
vertexNode.parentNode.removeChild(vertexNode);
|
||||||
@@ -161,7 +154,7 @@ export const addVertices = function (vert, g, svgId, root, doc, diagObj) {
|
|||||||
g.setNode(vertex.id, {
|
g.setNode(vertex.id, {
|
||||||
labelStyle: styles.labelStyle,
|
labelStyle: styles.labelStyle,
|
||||||
shape: _shape,
|
shape: _shape,
|
||||||
labelText: vertexText,
|
labelText,
|
||||||
labelType: vertex.labelType,
|
labelType: vertex.labelType,
|
||||||
rx: radious,
|
rx: radious,
|
||||||
ry: radious,
|
ry: radious,
|
||||||
@@ -329,7 +322,6 @@ export const addEdges = function (edges, g, diagObj) {
|
|||||||
edgeData.arrowheadStyle = 'fill: #333';
|
edgeData.arrowheadStyle = 'fill: #333';
|
||||||
edgeData.labelpos = 'c';
|
edgeData.labelpos = 'c';
|
||||||
}
|
}
|
||||||
|
|
||||||
edgeData.labelType = edge.labelType;
|
edgeData.labelType = edge.labelType;
|
||||||
edgeData.label = edge.text
|
edgeData.label = edge.text
|
||||||
.replace(common.lineBreakRegex, '\n')
|
.replace(common.lineBreakRegex, '\n')
|
||||||
|
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@@ -150,6 +150,7 @@ importers:
|
|||||||
jison: ^0.4.18
|
jison: ^0.4.18
|
||||||
js-base64: ^3.7.2
|
js-base64: ^3.7.2
|
||||||
jsdom: ^21.0.0
|
jsdom: ^21.0.0
|
||||||
|
katex: ^0.15.2
|
||||||
khroma: ^2.0.0
|
khroma: ^2.0.0
|
||||||
lodash-es: ^4.17.21
|
lodash-es: ^4.17.21
|
||||||
micromatch: ^4.0.5
|
micromatch: ^4.0.5
|
||||||
@@ -182,6 +183,7 @@ importers:
|
|||||||
dayjs: 1.11.7
|
dayjs: 1.11.7
|
||||||
dompurify: 2.4.5
|
dompurify: 2.4.5
|
||||||
elkjs: 0.8.2
|
elkjs: 0.8.2
|
||||||
|
katex: 0.15.6
|
||||||
khroma: 2.0.0
|
khroma: 2.0.0
|
||||||
lodash-es: 4.17.21
|
lodash-es: 4.17.21
|
||||||
non-layered-tidy-tree-layout: 2.0.2
|
non-layered-tidy-tree-layout: 2.0.2
|
||||||
@@ -4065,7 +4067,7 @@ packages:
|
|||||||
/axios/0.21.4_debug@4.3.2:
|
/axios/0.21.4_debug@4.3.2:
|
||||||
resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==}
|
resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
follow-redirects: 1.15.2_debug@4.3.4
|
follow-redirects: 1.15.2_debug@4.3.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- debug
|
- debug
|
||||||
dev: true
|
dev: true
|
||||||
@@ -6646,6 +6648,28 @@ packages:
|
|||||||
resolution: {integrity: sha512-XGozTsMPYkm+6b5QL3Z9wQcJjNYxp0CYn3U1gO7dwD6PAqU1SVWZxI9CCg3z+ml3YfqdPnrBehaBrnH2AGKbNA==}
|
resolution: {integrity: sha512-XGozTsMPYkm+6b5QL3Z9wQcJjNYxp0CYn3U1gO7dwD6PAqU1SVWZxI9CCg3z+ml3YfqdPnrBehaBrnH2AGKbNA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/follow-redirects/1.15.2:
|
||||||
|
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
|
||||||
|
engines: {node: '>=4.0'}
|
||||||
|
peerDependencies:
|
||||||
|
debug: '*'
|
||||||
|
peerDependenciesMeta:
|
||||||
|
debug:
|
||||||
|
optional: true
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/follow-redirects/1.15.2_debug@4.3.2:
|
||||||
|
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
|
||||||
|
engines: {node: '>=4.0'}
|
||||||
|
peerDependencies:
|
||||||
|
debug: '*'
|
||||||
|
peerDependenciesMeta:
|
||||||
|
debug:
|
||||||
|
optional: true
|
||||||
|
dependencies:
|
||||||
|
debug: 4.3.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
/follow-redirects/1.15.2_debug@4.3.4:
|
/follow-redirects/1.15.2_debug@4.3.4:
|
||||||
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
|
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
|
||||||
engines: {node: '>=4.0'}
|
engines: {node: '>=4.0'}
|
||||||
@@ -7195,7 +7219,7 @@ packages:
|
|||||||
engines: {node: '>=8.0.0'}
|
engines: {node: '>=8.0.0'}
|
||||||
dependencies:
|
dependencies:
|
||||||
eventemitter3: 4.0.7
|
eventemitter3: 4.0.7
|
||||||
follow-redirects: 1.15.2_debug@4.3.4
|
follow-redirects: 1.15.2
|
||||||
requires-port: 1.0.0
|
requires-port: 1.0.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- debug
|
- debug
|
||||||
|
Reference in New Issue
Block a user