mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 18:32:41 +00:00
Rename sanitizeHtml function to escapeTextForHtmlDisplay which better describes it's actual function
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user