diff --git a/web/app/controllers/problem.php b/web/app/controllers/problem.php
index 0da9869..788e1e1 100644
--- a/web/app/controllers/problem.php
+++ b/web/app/controllers/problem.php
@@ -522,15 +522,6 @@ $('#contest-countdown').countdown(= $contest['end_time']->getTimestamp() - UOJ
-
-
-
diff --git a/web/app/controllers/problem_managers_manage.php b/web/app/controllers/problem_managers_manage.php
index 1134fba..99bf811 100644
--- a/web/app/controllers/problem_managers_manage.php
+++ b/web/app/controllers/problem_managers_manage.php
@@ -192,14 +192,6 @@ table-hover
-
-
diff --git a/web/app/controllers/problem_solutions.php b/web/app/controllers/problem_solutions.php
index 929d32e..1eeaebc 100644
--- a/web/app/controllers/problem_solutions.php
+++ b/web/app/controllers/problem_solutions.php
@@ -298,12 +298,4 @@ EOD;
-
-
diff --git a/web/app/controllers/problem_statement_manage.php b/web/app/controllers/problem_statement_manage.php
index bd90e34..54d825a 100644
--- a/web/app/controllers/problem_statement_manage.php
+++ b/web/app/controllers/problem_statement_manage.php
@@ -168,14 +168,6 @@
-
-
diff --git a/web/app/controllers/problem_statistics.php b/web/app/controllers/problem_statistics.php
index bd1819b..f1b5331 100644
--- a/web/app/controllers/problem_statistics.php
+++ b/web/app/controllers/problem_statistics.php
@@ -369,15 +369,6 @@ $('#contest-countdown').countdown(= $contest['end_time']->getTimestamp() - UOJ
-
-
-
diff --git a/web/app/models/UOJBlogEditor.php b/web/app/models/UOJBlogEditor.php
index 04d10fa..c807a67 100644
--- a/web/app/models/UOJBlogEditor.php
+++ b/web/app/models/UOJBlogEditor.php
@@ -114,7 +114,14 @@ class UOJBlogEditor {
if ($this->show_editor) {
if ($this->type == 'blog') {
$content_md = $_POST[$this->name . '_content_md'];
- $this->post_data['content'] = $parsedown->text($this->post_data['content_md']);
+ $dom = new DOMDocument;
+ $dom->loadHTML(mb_convert_encoding($parsedown->text($this->post_data['content_md']), 'HTML-ENTITIES', 'UTF-8'));
+ $elements = $dom->getElementsByTagName('table');
+ foreach ($elements as $element) {
+ $element->setAttribute('class',
+ $element->getAttribute('class') . ' table table-bordered');
+ }
+ $this->post_data['content'] = $purifier->purify($dom->saveHTML());
if (preg_match('/^.*.*$/m', $this->post_data['content'], $matches, PREG_OFFSET_CAPTURE)) {
$content_less = substr($this->post_data['content'], 0, $matches[0][1]);
@@ -203,18 +210,6 @@ class UOJBlogEditor {
echo '';
echo $this->post_data['content'];
echo '';
-
- if (isset($REQUIRE_LIB['bootstrap5'])) {
- echo <<
-$(document).ready(function() {
- $('.markdown-body table').each(function() {
- $(this).addClass('table table-bordered');
- });
-});
-
-EOD;
- }
echoUOJPageFooter(array('ShowPageFooter' => false));
} elseif ($this->type == 'slide') {
uojIncludeView('slide', array_merge(
diff --git a/web/app/views/blog-preview.php b/web/app/views/blog-preview.php
index ec85ae8..ee050dd 100644
--- a/web/app/views/blog-preview.php
+++ b/web/app/views/blog-preview.php
@@ -39,16 +39,6 @@ text-decoration-none text-body
= $content ?>
-
-
-
-