浏览代码

Markdown can be enabled with a constant

master
Rocketsoup 3 年前
父节点
当前提交
081666351f
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3
    1
      htdocs/index.php

+ 3
- 1
htdocs/index.php 查看文件

65
 define('DUPLICATE_POST_SECONDS', 10);
65
 define('DUPLICATE_POST_SECONDS', 10);
66
 define('TIME_ZONE_DEFAULT', 'America/Los_Angeles');
66
 define('TIME_ZONE_DEFAULT', 'America/Los_Angeles');
67
 define('TOKEN_BYTES', 16);
67
 define('TOKEN_BYTES', 16);
68
+define('MARKDOWN_ENABLED', true);
68
 define('SESSION_KEY_ERROR', 'error');
69
 define('SESSION_KEY_ERROR', 'error');
69
 define('SESSION_KEY_LAST_ACCESS', 'last_access');
70
 define('SESSION_KEY_LAST_ACCESS', 'last_access');
70
 define('SESSION_KEY_POST_BODY', 'post_body');
71
 define('SESSION_KEY_POST_BODY', 'post_body');
890
 	}
891
 	}
891
 
892
 
892
 	public static function render_post(Post $post): void {
893
 	public static function render_post(Post $post): void {
893
-		$body_html = Markdown::markdown_to_html($post->body);
894
+		$body_html = MARKDOWN_ENABLED ? Markdown::markdown_to_html($post->body) :
895
+			self::post_body_html($post->body);
894
 		$date = localized_date_string($post->created);
896
 		$date = localized_date_string($post->created);
895
 		print(<<<HTML
897
 		print(<<<HTML
896
 			<div class="post">
898
 			<div class="post">

正在加载...
取消
保存