Update usage.md

This commit is contained in:
Neil Cuzon
2020-07-18 20:11:48 -07:00
committed by GitHub
parent 07f6572816
commit 56073fd522

View File

@@ -81,6 +81,24 @@ Would end up like this:
</body>
</html>
```
An id attribute is also added to mermaid tags without one. ## Simple full example:
### To enable click event and tags in nodes
In version 8.2 a security improvement was introduced. A `securityLevel` configuration was introduced which sets the level of trust to be used on the parsed diagrams.
* **true**: (default) tags in text are encoded, click functionality is disabled
* false: tags in text are allowed, click functionality is enabled
⚠️ **Note** : This changes the default behaviour of mermaid so that after upgrade to 8.2, if the `securityLevel` is not configured, tags in flowcharts are encoded as tags and clicking is prohibited.
If your application is taking resposibility for the diagram source security you can set the `securityLevel` accordingly. By doing this clicks and tags are again allowed.
```javascript
mermaidAPI.initialize({
securityLevel: 'loose'
});
```
## Notes:
An id attribute is also added to mermaid tags without one.