mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
pref: change detectors from .match
into .test
there is no need for matching, capturing results, and validating nullablity just using `.test` would be enough and significantly faster for more info, see https://stackoverflow.com/10940138/16476610
This commit is contained in:
@@ -3,7 +3,7 @@ import type { ExternalDiagramDefinition } from 'mermaid';
|
||||
const id = 'example-diagram';
|
||||
|
||||
const detector = (txt: string) => {
|
||||
return txt.match(/^\s*example-diagram/) !== null;
|
||||
return /^\s*example-diagram/.test(txt);
|
||||
};
|
||||
|
||||
const loader = async () => {
|
||||
|
Reference in New Issue
Block a user