Adding case check

This commit is contained in:
Knut Sveidqvist 2024-09-13 14:02:11 +02:00
parent 61af74609a
commit 4c26fe224b

View File

@ -321,6 +321,9 @@ 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;