Skip to content

Commit

Permalink
Merge branch 'master' into leading-whitespace-highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
lhw-1 authored Feb 26, 2025
2 parents 3cef17f + 2cadb78 commit 876b010
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
26 changes: 0 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"bootstrap-icons": "^1.11.3",
"bootswatch": "5.1.3",
"cheerio": "^0.22.0",
"crypto-js": "^4.0.0",
"csv-parse": "^4.14.2",
"ensure-posix-path": "^1.1.1",
"fastmatter": "^2.1.1",
Expand Down Expand Up @@ -78,7 +77,6 @@
"@jest/globals": "^29.5.0",
"@types/bluebird": "^3.5.36",
"@types/cheerio": "^0.22.31",
"@types/crypto-js": "^4.1.1",
"@types/domhandler": "^2.4.2",
"@types/fs-extra": "^9.0.13",
"@types/gh-pages": "^3.2.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/plugins/default/markbind-plugin-plantuml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import cheerio from 'cheerio';
import fs from 'fs';
import path from 'path';
import { exec } from 'child_process';
import cryptoJS from 'crypto-js';
import crypto = require('crypto');

import * as fsUtil from '../../utils/fsUtil';
import * as logger from '../../utils/logger';
Expand Down Expand Up @@ -42,7 +42,7 @@ let graphvizCheckCompleted = false;
* @param content puml dsl used to generate the puml diagram
*/
function generateDiagram(imageOutputPath: string, content: string) {
const hashKey = cryptoJS.MD5(imageOutputPath + content).toString();
const hashKey = crypto.createHash('md5').update(imageOutputPath + content).digest('hex').toString();

// Avoid generating twice
if (processedDiagrams.has(imageOutputPath) && processedDiagrams.get(imageOutputPath)?.hashKey === hashKey) {
Expand Down Expand Up @@ -164,7 +164,7 @@ export = {
delete node.attribs.name;
} else {
const normalizedContent = pumlContent.replace(/\r\n/g, '\n');
const hashedContent = cryptoJS.MD5(normalizedContent).toString();
const hashedContent = crypto.createHash('md5').update(normalizedContent).digest('hex').toString();
pathFromRootToImage = `${hashedContent}${PUML_EXT}`;
}

Expand Down

0 comments on commit 876b010

Please sign in to comment.