mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Refine empty line handling without changing line numbers
This commit is contained in:
parent
cd8e6371c6
commit
fd27ec177b
1 changed files with 11 additions and 2 deletions
|
|
@ -327,8 +327,17 @@ class TemplateHandler
|
|||
{
|
||||
$buff = rtrim($buff) . PHP_EOL;
|
||||
}
|
||||
$buff = preg_replace('/\n[\t\x20]*?(?=\n)/', "\n<?php ?>", $buff);
|
||||
$buff = preg_replace('/\n[\t\x20]+?\<\?php/', "\n<?php", $buff);
|
||||
$buff = preg_replace([
|
||||
'/>\<\?php } \?\>\n[\t\x20]*?(?=\n<!--)/',
|
||||
'/\n[\t\x20]*?(?=\n<!--)/',
|
||||
'/\n[\t\x20]*?(?=\n)/',
|
||||
'/\n[\t\x20]+?\<\?php/',
|
||||
], [
|
||||
"><?php } ?>\n<?php echo \"\\n\"; ?>",
|
||||
"\n",
|
||||
"\n<?php ?>",
|
||||
"\n<?php",
|
||||
], $buff);
|
||||
|
||||
// restore config to previous value
|
||||
$this->config = $previous_config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue