` with expected version number.
Example: https://unpkg.com/mermaid@7.1.0/dist/
-### Node.js
+##Incorporating mermaid to a website
+to support mermaid on your website, all you have to do is add Mermaid’s JavaScript package
```
-yarn add mermaid
+1.You will need to isntall node v10 or 12, which would have npm
+
+2. download yarn using npm
+
+2. yarn add mermaid
+
+3. yarn add --dev mermaid
```
-## Documentation
+## To install mermaid without a bundler, one can use the script tag like so:
+
+
+
+
+## it can then be followed by the diagram definitions as could be found in the examples in the documentation.
+
+# Documentation
https://mermaidjs.github.io
+
## Sibling projects
- [mermaid CLI](https://github.com/mermaidjs/mermaid.cli)
diff --git a/docs/Setup.md b/docs/Setup.md
index 15c10d91d..51b606eeb 100644
--- a/docs/Setup.md
+++ b/docs/Setup.md
@@ -11,7 +11,15 @@ It is is then up to the user of the API to make use of the svg, either insert it
In addition to the render function, a number of behavioral configuration options are available.
-## Configuration
+# Configuration
+
+
+
+# **Configuration methods in Mermaid version 8.6.0 have been updated, to learn more[[click here](https://github.com/NeilCuzon/mermaid/blob/develop/docs/8.6.0_docs.md)].**
+
+
+
+## **What follows are config instructions for older versions**
These are the default options which can be overridden with the initialization call like so:
**Example 1:**
@@ -49,9 +57,11 @@ A summary of all options and their defaults is found [here][2]. A description of
theme , the CSS style sheet
theme , the CSS style sheet
+
| Parameter | Description |Type | Required | Values|
-\| --- \| --- \| --- \| --- \| --- \|
-| Theme |Built in Themes| String | Optional | Values include, default, forest, dark, neutral, null|
+| --- | --- | --- | --- | --- |
+| Theme |Built in Themes| String | Optional | default, forest, dark, neutral, null|
+
**Notes:**To disable any pre-defined mermaid theme, use "null".
diff --git a/docs/img/GitHub-Mark-32px.png b/docs/img/GitHub-Mark-32px.png
new file mode 100644
index 000000000..8b25551a9
Binary files /dev/null and b/docs/img/GitHub-Mark-32px.png differ
diff --git a/docs/img/assignWithDepth.png b/docs/img/assignWithDepth.png
new file mode 100644
index 000000000..cc655cfbb
Binary files /dev/null and b/docs/img/assignWithDepth.png differ
diff --git a/docs/img/object.assign without depth.png b/docs/img/object.assign without depth.png
new file mode 100644
index 000000000..56f355521
Binary files /dev/null and b/docs/img/object.assign without depth.png differ
diff --git a/docs/img/without wrap.png b/docs/img/without wrap.png
new file mode 100644
index 000000000..e81add7ea
Binary files /dev/null and b/docs/img/without wrap.png differ
diff --git a/docs/img/wrapped text.png b/docs/img/wrapped text.png
new file mode 100644
index 000000000..78b635584
Binary files /dev/null and b/docs/img/wrapped text.png differ
diff --git a/src/mermaidAPI.spec.js b/src/mermaidAPI.spec.js
index e26c6bc11..157f5b3ac 100644
--- a/src/mermaidAPI.spec.js
+++ b/src/mermaidAPI.spec.js
@@ -65,6 +65,28 @@ describe('when using mermaidAPI and ', function() {
expect(mermaidAPI.getSiteConfig()).toEqual(siteConfig)
expect(mermaidAPI.getConfig()).toEqual(siteConfig);
});
+ it('should allow site config secure to global defaults', function() {
+ let config = {
+ logLevel: 0,
+ secure: ['foo']
+ };
+ mermaidAPI.initialize(config);
+ const siteConfig = mermaidAPI.getSiteConfig();
+ expect(mermaidAPI.getConfig().logLevel).toBe(0);
+ expect(mermaidAPI.getConfig().secure).toContain('foo');
+ config = {
+ logLevel: 3,
+ securityLevel: 'loose',
+ secure: ['foo', 'bar']
+ };
+ mermaidAPI.reinitialize(config);
+ expect(mermaidAPI.getConfig().secure).toEqual(mermaidAPI.getSiteConfig().secure);
+ expect(mermaidAPI.getConfig().securityLevel).toBe('strict');
+ expect(mermaidAPI.getConfig().secure).not.toContain('bar');
+ mermaidAPI.reset();
+ expect(mermaidAPI.getSiteConfig()).toEqual(siteConfig)
+ expect(mermaidAPI.getConfig()).toEqual(siteConfig);
+ });
it('should prevent changes to site defaults (sneaky)', function() {
let config = {
logLevel: 0
diff --git a/src/utils.js b/src/utils.js
index ddfa70151..79c2a1b2f 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -443,6 +443,13 @@ export const assignWithDepth = function(dst, src, config) {
if (Array.isArray(src) && !Array.isArray(dst)) {
src.forEach(s => assignWithDepth(dst, s, config));
return dst;
+ } else if (Array.isArray(src) && Array.isArray(dst)) {
+ src.forEach(s => {
+ if (dst.indexOf(s) === -1) {
+ dst.push(s);
+ }
+ });
+ return dst;
}
if (typeof dst === 'undefined' || depth <= 0) {
if (dst !== undefined && dst !== null && typeof dst === 'object' && typeof src === 'object') {