mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-11 08:56:02 +00:00
Added in a function to sanatize script tags specifically
This commit is contained in:
committed by
Rae2che5
parent
8b04cc9269
commit
20b719d0de
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "homebrewery",
|
||||
"description": "Create authentic looking D&D homebrews using only markdown",
|
||||
"version": "2.8.0",
|
||||
"version": "2.8.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/stolksdorf/homebrewery.git"
|
||||
|
||||
@@ -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