From 3c6108298ce5593fc6c82006cf64326f01dae3b5 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Sat, 30 Jul 2022 12:03:56 +0700 Subject: [PATCH] Add hard wrap to markdown --- judge/jinja2/markdown/__init__.py | 1 + templates/chat/chat.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/judge/jinja2/markdown/__init__.py b/judge/jinja2/markdown/__init__.py index 57af581..bf9c99a 100644 --- a/judge/jinja2/markdown/__init__.py +++ b/judge/jinja2/markdown/__init__.py @@ -155,6 +155,7 @@ def markdown(value, style, math_engine=None, lazy_load=False): inline=AwesomeInlineLexer, parse_block_html=1, parse_inline_html=1, + hard_wrap=True, ) result = markdown(value) if post_processors: diff --git a/templates/chat/chat.html b/templates/chat/chat.html index a51bbbb..155efa3 100644 --- a/templates/chat/chat.html +++ b/templates/chat/chat.html @@ -266,7 +266,7 @@ let META_HEADER = [ {% if last_msg and not request.profile.mute %} if ($("#chat-input").val().trim()) { var body = $('#chat-input').val().trim(); - body = body.split('\n').join('\n\n'); + // body = body.split('\n').join('\n\n'); var message = { body: body,