mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 21:02: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 };
|
const brew = { ...this.state.brew };
|
||||||
brew.pageCount = ((brew.renderer=='legacy' ? brew.text.match(/\\page/g) : brew.text.match(/^\\page$/gm)) || []).length + 1;
|
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.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.text = undefined;
|
||||||
brew.textBin = undefined;
|
brew.textBin = undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ const api = {
|
|||||||
const brewFromServer = req.brew;
|
const brewFromServer = req.brew;
|
||||||
splitTextStyleAndMetadata(brewFromServer);
|
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((brewFromServer?.version !== brewFromClient?.version) || (brewFromServer?.hash !== brewFromClient?.hash)) {
|
||||||
if(brewFromClient?.version !== brewFromClient?.version)
|
if(brewFromClient?.version !== brewFromClient?.version)
|
||||||
|
|||||||
Reference in New Issue
Block a user