mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-17 06:20:07 +02:00

Major improvements: - Fixed individual node tracking in subgraphs with consistent ordering - Resolved nested subgraph node ordering issues - Fixed markdown string processing for both nodes and edges - Improved error handling and validation - Enhanced FlowDB integration Progress: 97.4% pass rate (922 passed, 22 failed, 3 skipped) Target: 99.7% pass rate to match Jison parser performance Remaining issues: - Text processing for special characters (8 failures) - Node data multi-line string processing (4 failures) - Interaction parsing (3 failures) - Style/class assignment (2 failures) - Vertex chaining class assignment (1 failure) - Markdown subgraph titles (1 failure)
27 lines
762 B
JavaScript
27 lines
762 B
JavaScript
// Test backslash character parsing
|
|
const flow = require('./packages/mermaid/src/diagrams/flowchart/flowDb.ts');
|
|
|
|
// Set up ANTLR parser
|
|
process.env.USE_ANTLR_PARSER = 'true';
|
|
const antlrParser = require('./packages/mermaid/src/diagrams/flowchart/parser/antlr/antlr-parser.ts');
|
|
|
|
try {
|
|
console.log('Testing backslash character: \\');
|
|
|
|
// Test the problematic input
|
|
const input = 'graph TD; \\ --> A';
|
|
console.log('Input:', input);
|
|
|
|
// Parse with ANTLR
|
|
const result = antlrParser.parse(input);
|
|
console.log('Parse result:', result);
|
|
|
|
// Check vertices
|
|
const vertices = flow.getVertices();
|
|
console.log('Vertices:', vertices);
|
|
console.log('Backslash vertex:', vertices.get('\\'));
|
|
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
}
|