Skip to content

Mermaid flowchart parsing error for unquoted node labels with special characters #7590

@kunal-mermaid

Description

@kunal-mermaid

Description

A Mermaid diagram generated in ChatGPT (native Mermaid support) renders correctly in the ChatGPT preview.

However, when the exact same Mermaid code is copied and pasted into the Mermaid code editor, the editor shows a syntax error and the diagram fails to render.

This creates confusion for users because the diagram appears valid in ChatGPT but cannot be used directly in Mermaid Chart or the Mermaid editor.

flowchart TB %% ========================= %% High-level overview %% ========================= A([Grid Demand / Operator Setpoints]) --> OPS[Operations & Procedures] OPS --> HMI[Control Room HMI] HMI --> IACS[I&C + Reactor Protection System] %% ========================= %% Reactor core + physics %% ========================= subgraph CORE[Reactor Core + Neutronics] direction TB UO2[Fuel Pellets (UO2 / MOX)] RODS[Fuel Rods] ASM[Fuel Assemblies] MOD[Moderator (Light Water)] N[Neutron Population] FISS[Fission Events] HEAT[Heat in Fuel] FP[FP: Fission Products + Decay Heat] XEN[Xenon-135 Poisoning] BURN[Fuel Burnup / Reactivity Loss] DC[Delayed Neutrons] UO2 --> RODS --> ASM ASM --> FISS MOD --> N N --> FISS FISS --> HEAT FISS --> FP FP --> XEN FP --> DC XEN --> N BURN --> N end %% ========================= %% Reactivity control %% ========================= subgraph REACT[Reactivity Control] direction TB CR[Control Rod Banks] DR[Rod Drive Mechanisms] BOR[Boron (Soluble Poison)] CVCS[Chemical & Volume Control System] TCOEF[Temp Coefficient (Doppler + Moderator)] PCOEF[Power Coefficient] AXIAL[Axial Flux Shape Control] RHO[Reactivity ρ Balance] DR --> CR CVCS --> BOR CR --> RHO BOR --> RHO TCOEF --> RHO PCOEF --> RHO AXIAL --> RHO end RHO --> N %% ========================= %% Primary loop (pressurized) %% ========================= subgraph PRI[Primary Coolant System (High Pressure)] direction TB RPV[Reactor Pressure Vessel] PL[Primary Coolant (Water)] RCP[Reactor Coolant Pumps] SG[Steam Generator (Heat Exchanger)] PZR[Pressurizer] SPRAY[Pressurizer Spray] HEATERS[Pressurizer Heaters] PORV[PORV / Safety Relief] LETDOWN[Letdown Line] CHARGE[Charging Line] RCS[Reactor Coolant System] RPV --> PL --> RCP --> SG --> RPV PZR --- RCS RCS --- RPV PZR --> SPRAY PZR --> HEATERS PZR --> PORV RCS --> LETDOWN CHARGE --> RCS end HEAT --> PL %% ========================= %% Secondary loop (steam cycle) %% ========================= subgraph SEC[Secondary System (Steam/Feedwater)] direction TB FW[Feedwater] SG2[Steam Generator Secondary Side] MS[Main Steam] TURB[Turbine] GEN[Generator] COND[Condenser] CEP[Condensate Pumps] FWP[Feedwater Pumps] DEAR[Deaerator / Feedwater Heaters] BYP[Steam Dump / Bypass Valves] FW --> SG2 --> MS MS --> TURB --> GEN --> GRID[(Grid)] TURB --> COND --> CEP --> DEAR --> FWP --> FW MS --> BYP --> COND end SG --> SG2 %% ========================= %% Tertiary cooling (heat sink) %% ========================= subgraph HS[Heat Sink / Cooling Water] direction TB CW[Circulating Water] CWP[Circulating Water Pumps] CT[Cooling Tower / River / Sea] HX[Condenser Heat Rejection] CWP --> CW --> HX --> CT --> CWP end COND --- HX %% ========================= %% Instrumentation + control %% ========================= subgraph IANDC[Instrumentation, Control, and Protection] direction TB SENS[Core Detectors (Flux, Temp, Pressure)] EXCORE[Ex-core Neutron Detectors] THERM[Temp/Pressure/Flow Transmitters] SGLEVEL[Steam Gen Level Sensors] VIB[Turbine Vibration / Speed] LOGIC[Safety Logic (2oo3 / 2oo4)] CONTROL[Normal Control (PID + setpoints)] RPS[Reactor Protection System] ESFAS[Engineered Safety Features Actuation] ALARMS[Alarms + Annunciators] TREND[Trends + Historian] INTERLOCKS[Interlocks] SENS --> CONTROL EXCORE --> CONTROL THERM --> CONTROL SGLEVEL --> CONTROL VIB --> CONTROL SENS --> LOGIC EXCORE --> LOGIC THERM --> LOGIC SGLEVEL --> LOGIC LOGIC --> RPS LOGIC --> ESFAS CONTROL --> INTERLOCKS --> RPS RPS --> ALARMS CONTROL --> TREND end IACS --> CONTROL IACS --> LOGIC %% ========================= %% Trip and SCRAM actions %% ========================= subgraph TRIP[Trip / SCRAM] direction TB TRIG[Trip Conditions\n(high flux, low flow, low pressure,\nhigh pressure, SG low level, etc.)] SCRAM[SCRAM Signal] RODDROP[Control Rods Drop (Gravity/Springs)] TURBTRIP[Turbine Trip] MSIV[Main Steam Isolation Valves Close] FWISO[Feedwater Isolation] RXPOW[Reactor Power Falls] DECAY[Decay Heat Remains] TRIG --> SCRAM --> RODDROP --> RXPOW SCRAM --> TURBTRIP SCRAM --> MSIV SCRAM --> FWISO RXPOW --> DECAY end RPS --> SCRAM CONTROL --> TRIG LOGIC --> TRIG %% ========================= %% Safety systems (ESF) %% ========================= subgraph SAFETY[Safety Systems (Engineered Safety Features)] direction TB ECCS[ECCS (Emergency Core Cooling)] HPI[High Pressure Injection] LPI[Low Pressure Injection / RHR] ACC[Accumulators] SI[Safety Injection] SPRAYC[Containment Spray] FAN[Containment Fan Coolers] CSUMP[Containment Sump / Recirc] AFW[Aux Feedwater] DG[Diesel Generators] BAT[Batteries + DC buses] SW[Service Water / Essential Cooling] ISOL[Containment Isolation] VENT[Filtered Vent (if fitted)] HYD[Hydrogen Recombiner / Igniters] ESFAS --> SI --> ECCS ECCS --> HPI ECCS --> LPI ACC --> ECCS ESFAS --> AFW ESFAS --> ISOL ESFAS --> SPRAYC ESFAS --> FAN ESFAS --> HYD SPRAYC --> CSUMP --> LPI DG --> SW BAT --> SW DG --> ECCS BAT --> ECCS DG --> AFW BAT --> AFW end %% ========================= %% Containment + barriers %% ========================= subgraph BARRIERS[Defense-in-Depth Barriers] direction TB CLAD[Fuel Cladding] RCSBAR[RCS Boundary] CONT[Containment Building] SITE[Site Boundary / Emergency Planning] CLAD --> RCSBAR --> CONT --> SITE end RPV --- RCSBAR RODS --- CLAD ISOL --> CONT SPRAYC --> CONT HYD --> CONT VENT --> CONT %% ========================= %% Failure modes (simplified) %% ========================= subgraph EVENTS[Key Event Paths] direction TB LOCA[LOCA (Pipe Break)] SGTR[Steam Gen Tube Rupture] SBO[Station Blackout] LOSSFW[Loss of Feedwater] ATWS[ATWS (No SCRAM)] SEIS[Seismic / External Hazards] LOCA --> SI LOCA --> ACC LOSSFW --> AFW SBO --> DG SBO --> BAT SGTR --> ISOL ATWS --> BOR SEIS --> ISOL SEIS --> DG end %% ========================= %% Thermal balance links %% ========================= DECAY --> PL DECAY --> ECCS AFW --> SG2 HPI --> RCS LPI --> RCS SI --> RCS

Steps to reproduce

  • Paste the above code in the mermaid chart editor
  • Syntax error will occur

Screenshots

No response

Code Sample


Setup

  • Mermaid version:
  • Browser and Version: [Chrome, Edge, Firefox]

Suggested Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions