Skip to content

Commit

Permalink
hooks: List of renderers regex - add architecture and sort
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejKucia committed Oct 7, 2024
1 parent 8a5e8e0 commit 4ce8a3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Mermaid/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
* limitations under the License.
*/

// List of all renderers supported by mermaid, should be consistent with https://github.com/mermaid-js/mermaid/tree/develop/packages/mermaid/src/diagrams
// Each of the diagram types are using DiagramDetector
const mermaidStart =
/^(\s*)(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|requirementDiagram|gitGraph|C4Context|C4Container|C4Component|C4Dynamic|C4Deployment|timeline|mindmap|quadrantChart|xychart-beta|block-beta)/gm;
/^(\s*)(architecture(-beta)?|block(-beta)?|C4Context|C4Container|C4Component|C4Dynamic|C4Deployment|classDiagram-v2|classDiagram|erDiagram|graph|flowchart|gantt|gitGraph|info|mindmap|packet|pie|quadrantChart|requirement(Diagram)?|sankey|sequenceDiagram|stateDiagram|stateDiagram-v2|timeline|journey|xychart(-beta)?)/gm;

export const isMermaidCode = (code: string): boolean => {
if (code.startsWith('%%{init')) {
Expand Down

0 comments on commit 4ce8a3b

Please sign in to comment.