info diagram to show version of mermaid, bugfixes for gantt chart

This commit is contained in:
Knut Sveidqvist
2019-06-15 14:29:26 +02:00
parent 4cb0b9174b
commit 5667694652
12 changed files with 874 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
import * as d3 from 'd3'
import { logger } from './logger'
/**
* @function detectType
@@ -19,6 +20,7 @@ import * as d3 from 'd3'
*/
export const detectType = function (text) {
text = text.replace(/^\s*%%.*\n/g, '\n')
logger.debug('Detecting diagram type based on the text ' + text)
if (text.match(/^\s*sequenceDiagram/)) {
return 'sequence'
}
@@ -34,6 +36,11 @@ export const detectType = function (text) {
if (text.match(/^\s*gitGraph/)) {
return 'git'
}
if (text.match(/^\s*info/)) {
return 'info'
}
return 'flowchart'
}