From 56073fd522b6c8c0dfcffefc1248e88de461749f Mon Sep 17 00:00:00 2001 From: Neil Cuzon <58763315+NeilCuzon@users.noreply.github.com> Date: Sat, 18 Jul 2020 20:11:48 -0700 Subject: [PATCH] Update usage.md --- docs/usage.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/usage.md b/docs/usage.md index 8f2a0de0b..49433be93 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -81,6 +81,24 @@ Would end up like this: ``` +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.