Updated pie parsing with the new syntax + fix for flowDb

This commit is contained in:
Knut Sveidqvist
2022-04-30 15:13:28 +02:00
parent 8372d4952e
commit a401e44180
4 changed files with 51 additions and 45 deletions

View File

@@ -2,6 +2,13 @@ import { log } from '../../logger';
import mermaidAPI from '../../mermaidAPI';
import * as configApi from '../../config';
import common from '../common/common';
import {
setTitle,
getTitle,
getAccDescription,
setAccDescription,
clear as commonClear,
} from '../../commonDb';
let sections = {};
let title = '';
@@ -21,10 +28,6 @@ const addSection = function (id, value) {
};
const getSections = () => sections;
const setTitle = function (txt) {
title = common.sanitizeText(txt, configApi.getConfig());
};
const setShowData = function (toggle) {
showData = toggle;
};
@@ -33,18 +36,6 @@ const getShowData = function () {
return showData;
};
const getTitle = function () {
return title;
};
const setAccDescription = function (txt) {
description = common.sanitizeText(txt, configApi.getConfig());
};
const getAccDescription = function () {
return description;
};
const cleanupValue = function (value) {
if (value.substring(0, 1) === ':') {
value = value.substring(1).trim();
@@ -58,10 +49,8 @@ const clear = function () {
sections = {};
title = '';
showData = false;
commonClear();
};
// export const parseError = (err, hash) => {
// global.mermaidAPI.parseError(err, hash)
// }
export default {
parseDirective,
@@ -76,5 +65,4 @@ export default {
getShowData,
getAccDescription,
setAccDescription,
// parseError
};