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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user