phpbb论坛语法高亮插件o0johntam0o产生空白行的解决方法
发表于 : 周六 10月 18, 2025 1:09 am
该插件会自动为代码添加一个空行;如果原代码有一空行,则它会在原来的基础上增加1个空行。经过查找需要修改一下“\ext\o0johntam0o\codeboxplus\event\main_listener.php”文件中的第99行内容:
Code: [全选] [Expand/Collapse]
- // 修改前
- return $this->codebox_template(preg_replace('#\<br\\s*/?\>#msi', "\n", $arg[3]), $arg[1], $arg[2], $post_id, ++$part);
- // 修改后
- return $this->codebox_template(preg_replace('#\<br\\s*/?\>#msi', "", $arg[3]), $arg[1], $arg[2], $post_id, ++$part);