0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Integrated download function into server.js

Remove new function from `Homebrew.Model.js`
Remove `sourceFunctions.jsx` module
This commit is contained in:
G.Ambatte
2021-01-21 20:27:46 +13:00
parent 0e8348f360
commit 5c7a9c92d1
3 changed files with 52 additions and 70 deletions

View File

@@ -34,16 +34,6 @@ HomebrewSchema.methods.sanatize = function(full=false){
return brew;
};
HomebrewSchema.methods.escapeTextForHtmlDisplay = function(){
const replaceStrings = { '&': '&amp;', '<': '&lt;', '>': '&gt;' };
text = this.text;
for (const replaceStr in replaceStrings) {
text = text.replaceAll(replaceStr, replaceStrings[replaceStr]);
}
text = `<code><pre style="white-space: pre-wrap;">${text}</pre></code>`;
return text;
};
HomebrewSchema.methods.increaseView = async function(){
this.lastViewed = new Date();
this.views = this.views + 1;