mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Disable all conversion inside verbatim section of template v2
This commit is contained in:
parent
f7543e4c9a
commit
451d0b95ac
2 changed files with 35 additions and 1 deletions
|
|
@ -138,9 +138,9 @@ class TemplateParser_v2
|
|||
// Apply conversions.
|
||||
$content = $this->_addContextSwitches($content);
|
||||
$content = $this->_removeComments($content);
|
||||
$content = $this->_convertVerbatimSections($content);
|
||||
$content = $this->_convertRelativePaths($content);
|
||||
$content = $this->_convertPHPSections($content);
|
||||
$content = $this->_convertVerbatimSections($content);
|
||||
$content = $this->_convertFragments($content);
|
||||
$content = $this->_convertClassAliases($content);
|
||||
$content = $this->_convertIncludes($content);
|
||||
|
|
|
|||
|
|
@ -1115,6 +1115,40 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
|
|||
'',
|
||||
]);
|
||||
$this->assertEquals($target, $this->_parse($source));
|
||||
|
||||
// @verbatim block inside @php block
|
||||
$source = implode("\n", [
|
||||
'@php',
|
||||
'@verbatim',
|
||||
'$foo = $bar->$baz;',
|
||||
'@endverbatim',
|
||||
'@endphp',
|
||||
]);
|
||||
$target = implode("\n", [
|
||||
'<?php',
|
||||
'',
|
||||
'$foo = $bar->$baz;',
|
||||
'',
|
||||
'?>',
|
||||
]);
|
||||
$this->assertEquals($target, $this->_parse($source));
|
||||
|
||||
// @php block inside @verbatim block
|
||||
$source = implode("\n", [
|
||||
'@verbatim',
|
||||
'@php',
|
||||
'$foo = $bar->$baz;',
|
||||
'@endphp',
|
||||
'@endverbatim',
|
||||
]);
|
||||
$target = implode("\n", [
|
||||
'',
|
||||
'@php',
|
||||
'$foo = $bar->$baz;',
|
||||
'@endphp',
|
||||
'',
|
||||
]);
|
||||
$this->assertEquals($target, $this->_parse($source));
|
||||
}
|
||||
|
||||
public function testRawPhpCode()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue