mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-12-06 04:24:10 +01:00
Moving case check to parsing
This commit is contained in:
@@ -133,6 +133,10 @@ export const addVertex = function (
|
|||||||
}
|
}
|
||||||
// console.log('yamlData', yamlData);
|
// console.log('yamlData', yamlData);
|
||||||
const doc = yaml.load(yamlData, { schema: yaml.JSON_SCHEMA }) as NodeMetaData;
|
const doc = yaml.load(yamlData, { schema: yaml.JSON_SCHEMA }) as NodeMetaData;
|
||||||
|
if (doc.shape && doc.shape !== doc.shape.toLowerCase()) {
|
||||||
|
throw new Error(`No such shape: ${node.shape}. Shape names should be lowercase.`);
|
||||||
|
}
|
||||||
|
|
||||||
// console.log('yamlData doc', doc);
|
// console.log('yamlData doc', doc);
|
||||||
if (doc?.shape) {
|
if (doc?.shape) {
|
||||||
vertex.type = doc?.shape;
|
vertex.type = doc?.shape;
|
||||||
|
|||||||
@@ -321,9 +321,7 @@ export const insertNode = async (elem, node, renderOptions) => {
|
|||||||
if (!shapes[node.shape]) {
|
if (!shapes[node.shape]) {
|
||||||
throw new Error(`No such shape: ${node.shape}. Please check your syntax.`);
|
throw new Error(`No such shape: ${node.shape}. Please check your syntax.`);
|
||||||
}
|
}
|
||||||
if (node.shape !== node.shape.toLowerCase()) {
|
|
||||||
throw new Error(`No such shape: ${node.shape}. Shape names should be lowercase.`);
|
|
||||||
}
|
|
||||||
if (node.link) {
|
if (node.link) {
|
||||||
// Add link when appropriate
|
// Add link when appropriate
|
||||||
let target;
|
let target;
|
||||||
|
|||||||
Reference in New Issue
Block a user