mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-22 01:26:54 +00:00
Rename sanitizeHtml function to escapeTextForHtmlDisplay which better describes it's actual function
This commit is contained in:
1 parent
e8135fcbb4
commit
8060ed5f8e
1 file changed
+2
-3
@@ -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