mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-03 06:09:45 +02:00
#1408 Removing crypto-random-string and he
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import randomString from 'crypto-random-string';
|
||||
|
||||
import { logger } from '../../logger';
|
||||
|
||||
let commits = {};
|
||||
@@ -9,11 +7,18 @@ let curBranch = 'master';
|
||||
let direction = 'LR';
|
||||
let seq = 0;
|
||||
|
||||
function makeid(length) {
|
||||
var result = '';
|
||||
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
var charactersLength = characters.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function getId() {
|
||||
return randomString({
|
||||
length: 7,
|
||||
characters: '0123456789abcdef'
|
||||
});
|
||||
return makeid(7);
|
||||
}
|
||||
|
||||
function isfastforwardable(currentCommit, otherCommit) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
/* eslint-env jasmine */
|
||||
// Todo reintroduce without cryptoRandomString
|
||||
import gitGraphAst from './gitGraphAst';
|
||||
import { parser } from './parser/gitGraph';
|
||||
import randomString from 'crypto-random-string';
|
@@ -2,8 +2,8 @@
|
||||
* Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render
|
||||
* the diagrams to svg code.
|
||||
*/
|
||||
import he from 'he';
|
||||
|
||||
// import { decode } from 'he';
|
||||
import decode from 'entity-decode/browser';
|
||||
import mermaidAPI from './mermaidAPI';
|
||||
import { logger } from './logger';
|
||||
/**
|
||||
@@ -94,8 +94,7 @@ const init = function() {
|
||||
txt = element.innerHTML;
|
||||
|
||||
// transforms the html to pure text
|
||||
txt = he
|
||||
.decode(txt)
|
||||
txt = decode(txt)
|
||||
.trim()
|
||||
.replace(/<br\s*\/?>/gi, '<br/>');
|
||||
|
||||
|
Reference in New Issue
Block a user