From c5980cf1fd0ea0c0f4f3ae02f57c0f80d021e90f Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Wed, 22 Mar 2023 14:04:02 +0800 Subject: [PATCH] fix: bfdca1176103122c840ea37d86103cf264efddb2 --- web/js/uoj.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/js/uoj.js b/web/js/uoj.js index 61298f7..57d35b3 100644 --- a/web/js/uoj.js +++ b/web/js/uoj.js @@ -742,7 +742,7 @@ $.fn.source_code_form_group = function(name, text, langs_options_html) { var show_help_forbidden_code = function(lang, code) { if (lang == 'C' || lang.startsWith('C++')) { - if (/(^|\n)\s*#pragma/.test(code)) { + if (/\n\s*#pragma/.test('\n' + code)) { div_help_forbidden_code.text('注意:C/C++ 程序源代码中不应包含 #pragma 指令,这在正式比赛中是不被允许的。'); } } else {