0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

NOrmalize strings before rnuning MD5s

This commit is contained in:
David Bolack
2025-07-09 18:52:45 -05:00
parent 1d92b98568
commit 81e20f032e
2 changed files with 2 additions and 2 deletions

View File

@@ -262,7 +262,7 @@ const EditPage = createClass({
const brew = { ...this.state.brew };
brew.pageCount = ((brew.renderer=='legacy' ? brew.text.match(/\\page/g) : brew.text.match(/^\\page$/gm)) || []).length + 1;
brew.patches = stringifyPatches(makePatches(this.savedBrew.text, brew.text));
brew.hash = await md5(this.savedBrew.text);
brew.hash = await md5(this.savedBrew.text.normalize());
brew.text = undefined;
brew.textBin = undefined;

View File

@@ -341,7 +341,7 @@ const api = {
const brewFromServer = req.brew;
splitTextStyleAndMetadata(brewFromServer);
brewFromServer.hash = await md5(brewFromServer.text);
brewFromServer.hash = await md5(brewFromServer.text.normalize());
if((brewFromServer?.version !== brewFromClient?.version) || (brewFromServer?.hash !== brewFromClient?.hash)) {
if(brewFromClient?.version !== brewFromClient?.version)