mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 01:22:44 +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;
|
return brew;
|
||||||
};
|
};
|
||||||
|
|
||||||
HomebrewSchema.methods.sanitizeHtml = function(){
|
HomebrewSchema.methods.escapeTextForHtmlDisplay = function(){
|
||||||
const brew = this.toJSON();
|
|
||||||
const replaceStrings = { '&': '&', '<': '<', '>': '>' };
|
const replaceStrings = { '&': '&', '<': '<', '>': '>' };
|
||||||
text = brew.text;
|
text = this.text;
|
||||||
for (const replaceStr in replaceStrings) {
|
for (const replaceStr in replaceStrings) {
|
||||||
text = text.replaceAll(replaceStr, replaceStrings[replaceStr]);
|
text = text.replaceAll(replaceStr, replaceStrings[replaceStr]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user