mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-29 17:42:38 +00:00
Added in a function to sanatize script tags specifically
This commit is contained in:
committed by
Rae2che5
parent
8b04cc9269
commit
20b719d0de
@@ -13,6 +13,11 @@ renderer.html = function (html) {
|
||||
return html;
|
||||
};
|
||||
|
||||
const sanatizeScriptTags = (content)=>{
|
||||
return content
|
||||
.replace(/<script/g, '<script')
|
||||
.replace(/<\/script>/g, '</script>');
|
||||
};
|
||||
|
||||
const tagTypes = ['div', 'span', 'a'];
|
||||
const tagRegex = new RegExp(`(${
|
||||
@@ -24,7 +29,10 @@ const tagRegex = new RegExp(`(${
|
||||
module.exports = {
|
||||
marked : Markdown,
|
||||
render : (rawBrewText)=>{
|
||||
return Markdown(rawBrewText, { renderer: renderer });
|
||||
return Markdown(
|
||||
sanatizeScriptTags(rawBrewText),
|
||||
{ renderer: renderer }
|
||||
);
|
||||
},
|
||||
|
||||
validate : (rawBrewText)=>{
|
||||
|
||||
Reference in New Issue
Block a user