[limb-svn] r7000 - in 3.x/trunk/limb/macro: src/compiler src/tags/core tests/cases/tags/core
svn at limb-project.com
svn at limb-project.com
Sun May 11 21:05:42 MSD 2008
Author: pachanga
Date: 2008-05-11 21:05:42 +0400 (Sun, 11 May 2008)
New Revision: 7000
URL: http://fisheye.limb-project.com/changelog/limb/?cs=7000
Modified:
3.x/trunk/limb/macro/src/compiler/lmbMacroTextNode.class.php
3.x/trunk/limb/macro/src/tags/core/nospace.tag.php
3.x/trunk/limb/macro/tests/cases/tags/core/lmbMacroNospaceTagTest.class.php
Log:
-- nospace tag made more simple and predictable
Modified: 3.x/trunk/limb/macro/src/compiler/lmbMacroTextNode.class.php
===================================================================
--- 3.x/trunk/limb/macro/src/compiler/lmbMacroTextNode.class.php 2008-05-11 08:05:43 UTC (rev 6999)
+++ 3.x/trunk/limb/macro/src/compiler/lmbMacroTextNode.class.php 2008-05-11 17:05:42 UTC (rev 7000)
@@ -15,7 +15,6 @@
*/
class lmbMacroTextNode extends lmbMacroNode
{
- protected static $trim = false;
protected $contents;
function __construct($location, $text)
@@ -26,19 +25,10 @@
function generate($code_writer)
{
- if(self :: $trim)
- $code_writer->writeHtml(trim($this->contents));
- else
- $code_writer->writeHtml($this->contents);
-
+ $code_writer->writeHtml($this->contents);
parent :: generate($code_writer);
}
- static function setTrim($flag = true)
- {
- self :: $trim = $flag;
- }
-
function getText()
{
return $this->contents;
Modified: 3.x/trunk/limb/macro/src/tags/core/nospace.tag.php
===================================================================
--- 3.x/trunk/limb/macro/src/tags/core/nospace.tag.php 2008-05-11 08:05:43 UTC (rev 6999)
+++ 3.x/trunk/limb/macro/src/tags/core/nospace.tag.php 2008-05-11 17:05:42 UTC (rev 7000)
@@ -2,14 +2,13 @@
/**
* class lmbMacroNospaceTag.
* @tag nospace
- * @restrict_self_nesting
+ * @aliases -
+ * @forbid_end_tag
*/
class lmbMacroNospaceTag extends lmbMacroTag
{
protected function _generateContent($code)
{
- lmbMacroTextNode :: setTrim(true);
- parent :: _generateContent($code);
- lmbMacroTextNode :: setTrim(false);
+ $code->writeHtml("");
}
}
Modified: 3.x/trunk/limb/macro/tests/cases/tags/core/lmbMacroNospaceTagTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/tags/core/lmbMacroNospaceTagTest.class.php 2008-05-11 08:05:43 UTC (rev 6999)
+++ 3.x/trunk/limb/macro/tests/cases/tags/core/lmbMacroNospaceTagTest.class.php 2008-05-11 17:05:42 UTC (rev 7000)
@@ -9,22 +9,17 @@
class lmbMacroNospaceTagTest extends lmbBaseMacroTest
{
- function testTrimSpace()
+ function testNospace()
{
- $template = '{{nospace}} Bob {{/nospace}}';
-
- $page = $this->_createMacroTemplate($template, 'tpl.html');
+ $template = " Todd {{-
- $this->assertEqual($page->render(), 'Bob');
- }
+ }} Bob {{-
+
+ }}Hey\n Tomm";
- function testMixTrimAndNoTrim()
- {
- $template = ' Todd {{nospace}} Bob {{/nospace}} Hey';
-
$page = $this->_createMacroTemplate($template, 'tpl.html');
- $this->assertEqual($page->render(), ' Todd Bob Hey');
+ $this->assertEqual($page->render(), " Todd Bob Hey\n Tomm");
}
}
More information about the limb-svn
mailing list