mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-04 22:59:50 +02:00
fix: Use AST to replace notes & warnings.
This commit is contained in:
@@ -32,10 +32,8 @@ statement
|
||||
|
||||
In the extract of the grammar above, it is defined that a call to the setTitle method in the data object will be done when parsing and the title keyword is encountered.
|
||||
|
||||
> **Note**\
|
||||
> **Note**
|
||||
> Make sure that the `parseError` function for the parser is defined and calling `mermaid.parseError`. This way a common way of detecting parse errors is provided for the end-user.
|
||||
>
|
||||
> >
|
||||
|
||||
For more info look in the example diagram type:
|
||||
|
||||
@@ -50,8 +48,7 @@ exports.parseError = function (err, hash) {
|
||||
when parsing the `yy` object is initialized as per below:
|
||||
|
||||
```javascript
|
||||
var parser;
|
||||
parser = exampleParser.parser;
|
||||
const parser = exampleParser.parser;
|
||||
parser.yy = db;
|
||||
```
|
||||
|
||||
@@ -74,8 +71,8 @@ At this point when mermaid is trying to render the diagram, it will detect it as
|
||||
### Setup
|
||||
|
||||
```javascript
|
||||
var graph = require('./graphDb');
|
||||
var flow = require('./parser/flow');
|
||||
const graph = require('./graphDb');
|
||||
const flow = require('./parser/flow');
|
||||
flow.parser.yy = graph;
|
||||
```
|
||||
|
||||
@@ -96,7 +93,7 @@ graph.getEdges();
|
||||
The parser is also exposed in the mermaid api by calling:
|
||||
|
||||
```javascript
|
||||
var parser = mermaid.getParser();
|
||||
const parser = mermaid.getParser();
|
||||
```
|
||||
|
||||
Note that the parse needs a graph object to store the data as per:
|
||||
|
Reference in New Issue
Block a user