diff --git a/server/homebrew.model.js b/server/homebrew.model.js index 05b94663a..3d417f9e8 100644 --- a/server/homebrew.model.js +++ b/server/homebrew.model.js @@ -34,10 +34,9 @@ HomebrewSchema.methods.sanatize = function(full=false){ return brew; }; -HomebrewSchema.methods.sanitizeHtml = function(){ - const brew = this.toJSON(); +HomebrewSchema.methods.escapeTextForHtmlDisplay = function(){ const replaceStrings = { '&': '&', '<': '<', '>': '>' }; - text = brew.text; + text = this.text; for (const replaceStr in replaceStrings) { text = text.replaceAll(replaceStr, replaceStrings[replaceStr]); }