Use timestamp to generate uniq id

This commit is contained in:
Tyler Long 2018-03-11 22:46:59 +08:00
parent a0b589979d
commit 5b6dfb01a6
1 changed files with 1 additions and 3 deletions

View File

@ -7,8 +7,6 @@ import he from 'he'
import mermaidAPI from './mermaidAPI'
import { logger } from './logger'
let nextId = 0
/**
* ## init
* Function that goes through the document to find the chart definitions in there and render them.
@ -87,7 +85,7 @@ const init = function () {
continue
}
const id = 'mermaidChart' + nextId++
const id = `mermaid-${Date.now()}`
// Fetch the graph definition including tags
txt = element.innerHTML