mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Moving case check to parsing
This commit is contained in:
parent
4c26fe224b
commit
44561f57d3
@ -133,6 +133,10 @@ export const addVertex = function (
|
||||
}
|
||||
// console.log('yamlData', yamlData);
|
||||
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);
|
||||
if (doc?.shape) {
|
||||
vertex.type = doc?.shape;
|
||||
|
@ -321,9 +321,7 @@ export const insertNode = async (elem, node, renderOptions) => {
|
||||
if (!shapes[node.shape]) {
|
||||
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) {
|
||||
// Add link when appropriate
|
||||
let target;
|
||||
|
Loading…
x
Reference in New Issue
Block a user