mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 13:29:40 +02:00
Compare commits
4 Commits
v9.2.0
...
release_9.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2243af1871 | ||
![]() |
41dbf0fa96 | ||
![]() |
1a5e7315c0 | ||
![]() |
da6bb9498a |
@@ -2,10 +2,10 @@
|
|||||||
"name": "mermaid",
|
"name": "mermaid",
|
||||||
"version": "9.2.0",
|
"version": "9.2.0",
|
||||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||||
"main": "./dist/mermaid.core.mjs",
|
"main": "./dist/mermaid.min.js",
|
||||||
"module": "./dist/mermaid.core.mjs",
|
"module": "./dist/mermaid.core.mjs",
|
||||||
"types": "./dist/mermaid.d.ts",
|
"types": "./dist/mermaid.d.ts",
|
||||||
"type": "module",
|
"type": "commonjs",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"require": "./dist/mermaid.min.js",
|
"require": "./dist/mermaid.min.js",
|
||||||
|
@@ -482,9 +482,9 @@ const parseAsync = (txt: string) => {
|
|||||||
const renderAsync = (
|
const renderAsync = (
|
||||||
id: string,
|
id: string,
|
||||||
text: string,
|
text: string,
|
||||||
cb: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
cb?: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
||||||
container?: Element
|
container?: Element
|
||||||
): Promise<void> => {
|
): Promise<string> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// This promise will resolve when the mermaidAPI.render call is done.
|
// This promise will resolve when the mermaidAPI.render call is done.
|
||||||
// It will be queued first and will be executed when it is first in line
|
// It will be queued first and will be executed when it is first in line
|
||||||
|
@@ -115,19 +115,19 @@ export const decodeEntities = function (text: string): string {
|
|||||||
*
|
*
|
||||||
* @param {string} id The id of the element to be rendered
|
* @param {string} id The id of the element to be rendered
|
||||||
* @param {string} text The graph definition
|
* @param {string} text The graph definition
|
||||||
* @param {(svgCode: string, bindFunctions?: (element: Element) => void) => void} cb Callback which
|
* @param cb - Optional callback which
|
||||||
* is called after rendering is finished with the svg code as inparam.
|
* is called after rendering is finished with the svg code as inparam.
|
||||||
* @param {Element} container Selector to element in which a div with the graph temporarily will be
|
* @param {Element} container Selector to element in which a div with the graph temporarily will be
|
||||||
* inserted. If one is provided a hidden div will be inserted in the body of the page instead. The
|
* inserted. If one is provided a hidden div will be inserted in the body of the page instead. The
|
||||||
* element will be removed when rendering is completed.
|
* element will be removed when rendering is completed.
|
||||||
* @returns {void}
|
* @returns Returns the rendered element as a string containing the SVG definition.
|
||||||
*/
|
*/
|
||||||
const render = function (
|
const render = function (
|
||||||
id: string,
|
id: string,
|
||||||
text: string,
|
text: string,
|
||||||
cb: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
cb?: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
||||||
container?: Element
|
container?: Element
|
||||||
): void {
|
): string {
|
||||||
addDiagrams();
|
addDiagrams();
|
||||||
configApi.reset();
|
configApi.reset();
|
||||||
text = text.replace(/\r\n?/g, '\n'); // parser problems on CRLF ignore all CR and leave LF;;
|
text = text.replace(/\r\n?/g, '\n'); // parser problems on CRLF ignore all CR and leave LF;;
|
||||||
@@ -401,9 +401,9 @@ const render = function (
|
|||||||
const renderAsync = async function (
|
const renderAsync = async function (
|
||||||
id: string,
|
id: string,
|
||||||
text: string,
|
text: string,
|
||||||
cb: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
cb?: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
||||||
container?: Element
|
container?: Element
|
||||||
): Promise<void> {
|
): Promise<string> {
|
||||||
addDiagrams();
|
addDiagrams();
|
||||||
configApi.reset();
|
configApi.reset();
|
||||||
text = text.replace(/\r\n?/g, '\n'); // parser problems on CRLF ignore all CR and leave LF;;
|
text = text.replace(/\r\n?/g, '\n'); // parser problems on CRLF ignore all CR and leave LF;;
|
||||||
|
Reference in New Issue
Block a user