增加函数统一处理markdown

This commit is contained in:
2024-12-06 16:38:44 +08:00
parent 488b6974d2
commit 63ec75c092

View File

@@ -118,19 +118,21 @@ if ($pr_flag) {
<?php } ?>
</div>
</div>
<?php
function trans_md($str)
{
return bbcode_to_html("<span class='md'>" + bbcode_to_html(
htmlentities($str, ENT_QUOTES, 'UTF-8')
) + "</span>");
}
?>
<div class="row">
<div class="column">
<h4 class="ui top attached block header"><?php echo $MSG_Description ?></h4>
<div id="description" class="ui bottom attached segment font-content">
<span class='md'>
<?php
echo bbcode_to_html(
htmlentities ($row['description'], ENT_QUOTES, 'UTF-8')
);
?>
</span>
<?php
echo trans_md($row['description']);
?>
</div>
</div>
</div>
@@ -139,14 +141,9 @@ if ($pr_flag) {
<div class="column">
<h4 class="ui top attached block header"><?php echo $MSG_Input ?></h4>
<div id='input' class="ui bottom attached segment font-content">
<span class='md'>
<?php echo
bbcode_to_html(
htmlentities ($row['input'], ENT_QUOTES, 'UTF-8')
);
?>
</span>
<?php
echo trans_md($row['input']);
?>
</div>
</div>
</div>
@@ -156,14 +153,9 @@ if ($pr_flag) {
<div class="column">
<h4 class="ui top attached block header"><?php echo $MSG_Output ?></h4>
<div id='output' class="ui bottom attached segment font-content">
<span class='md'>
<?php echo
bbcode_to_html(
htmlentities ($row['output'], ENT_QUOTES, 'UTF-8')
);
?>
</span>
<?php
echo trans_md($row['output']);
?>
</div>
</div>
</div>
@@ -213,14 +205,9 @@ if ($pr_flag) {
<div class="column">
<h4 class="ui top attached block header"><?php echo $MSG_HINT ?></h4>
<div id='hint' class="ui bottom attached segment font-content hint">
<span class='md'>
<?php echo
bbcode_to_html(
htmlentities ($row['hint'], ENT_QUOTES, 'UTF-8')
);
?>
</span>
<?php
echo trans_md($row['hint']);
?>
</div>
</div>
</div>