mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 19:42:15 +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 = rtrim($buff) . PHP_EOL;
|
||||||
}
|
}
|
||||||
$buff = preg_replace('/\n[\t\x20]*?(?=\n)/', "\n<?php ?>", $buff);
|
$buff = preg_replace([
|
||||||
$buff = preg_replace('/\n[\t\x20]+?\<\?php/', "\n<?php", $buff);
|
'/>\<\?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
|
// restore config to previous value
|
||||||
$this->config = $previous_config;
|
$this->config = $previous_config;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue