diff --git a/Source/Modules/HTML.py b/Source/Modules/HTML.py
new file mode 100644
index 0000000..9b84ad8
--- /dev/null
+++ b/Source/Modules/HTML.py
@@ -0,0 +1,19 @@
+""" ================================= |
+| This file is part of |
+| staticoso |
+| Just a simple Static Site Generator |
+| |
+| Licensed under the AGPLv3 license |
+| Copyright (C) 2022, OctoSpacc |
+| ================================= """
+
+from Libs.bs4 import BeautifulSoup
+from Modules.Utils import *
+
+def StripTags(HTML, ToStrip):
+ Soup = BeautifulSoup(HTML, 'html.parser')
+ Tags = Soup.find_all()
+ for t in Tags:
+ if t.name in ToStrip:
+ t.replace_with('')
+ return str(Soup)
diff --git a/Source/Modules/Site.py b/Source/Modules/Site.py
index dfe38b5..abdb96f 100644
--- a/Source/Modules/Site.py
+++ b/Source/Modules/Site.py
@@ -9,6 +9,7 @@
from Libs import htmlmin
from Libs.bs4 import BeautifulSoup
+from Modules.HTML import *
from Modules.Markdown import *
from Modules.Pug import *
from Modules.Utils import *
@@ -403,10 +404,7 @@ def MakeSite(TemplatesText, PartsText, ContextParts, ContextPartsText, ConfMenu,
SiteLang=SiteLang,
Locale=Locale)
if NoScripts:
- HTML = (HTML
- ).replace('', ' script -->')
+ HTML = StripTags(HTML, ['script'])
if Minify:
HTML = DoMinifyHTML(HTML)
WriteFile(PagePath, HTML)
diff --git a/TODO b/TODO
index 2c38a62..365f777 100644
--- a/TODO
+++ b/TODO
@@ -1,2 +1,2 @@
- ActivityPub: Only post "Blog" posts and not older than some date
-- Fix some CLI arguments stuff
+- Fix arguments - some are only callable from CLI and not Site.ini