Skip to content

Commit

Permalink
Fixed stripping of space before tal:content
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jan 4, 2012
1 parent 27424eb commit 8059cdf
Show file tree
Hide file tree
Showing 58 changed files with 100 additions and 149 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -14,7 +14,7 @@ docs::

doc::
$(MAKE) $(MFLAGS) -C doc

clean::
@if test -d ./build/; then rm -rf ./build/; fi
@find . \( -name \*.rej -o -name \*.orig -o -name .DS_Store -o -name ._\* \) -print -exec rm {} \;
12 changes: 6 additions & 6 deletions build.xml
Expand Up @@ -151,13 +151,13 @@ PHPTAL compiles templates to PHP for best performance and supports selective cac
<element key="name" value="gettext" />
<element key="optional" value="yes" />
</element>

<element>
<element key="type" value="ext" />
<element key="rel" value="has" />
<element key="name" value="SimpleXML" />
<element key="optional" value="yes" />
</element>
</element>

<element>
<element key="type" value="ext" />
Expand Down Expand Up @@ -191,8 +191,8 @@ PHPTAL compiles templates to PHP for best performance and supports selective cac
<delete file="${tarfile}"/>
<tar destfile="${tarfile}">
<fileset dir="${build.base.dir}">
<include name="${pkgname}/**" />
<include name="package.xml" />
<include name="${pkgname}/**" />
<include name="package.xml" />
</fileset>
</tar>
</target>
Expand All @@ -209,8 +209,8 @@ PHPTAL compiles templates to PHP for best performance and supports selective cac
<delete file="${tarfilepear}"/>
<tar destfile="${tarfilepear}">
<fileset dir="${build.base.dir}">
<include name="${pkgname}/**" />
<include name="package.xml" />
<include name="${pkgname}/**" />
<include name="package.xml" />
</fileset>
</tar>
</target>
Expand Down
1 change: 0 additions & 1 deletion classes/PHPTAL/ConfigurationException.php
Expand Up @@ -22,4 +22,3 @@
class PHPTAL_ConfigurationException extends PHPTAL_Exception
{
}

1 change: 0 additions & 1 deletion classes/PHPTAL/Dom/CDATASection.php
Expand Up @@ -45,4 +45,3 @@ public function generateCode(PHPTAL_Php_CodeWriter $codewriter)
}
}
}

1 change: 0 additions & 1 deletion classes/PHPTAL/Dom/PHP5DOMDocumentBuilder.php
Expand Up @@ -251,4 +251,3 @@ public function setEncoding($encoding)
}
}
}

1 change: 0 additions & 1 deletion classes/PHPTAL/Dom/PHPTALDocumentBuilder.php
Expand Up @@ -164,4 +164,3 @@ public function setEncoding($encoding)
$this->encoding = $encoding;
}
}

1 change: 0 additions & 1 deletion classes/PHPTAL/Dom/XmlDeclaration.php
Expand Up @@ -27,4 +27,3 @@ public function generateCode(PHPTAL_Php_CodeWriter $codewriter)
$codewriter->doXmlDeclaration();
}
}

1 change: 0 additions & 1 deletion classes/PHPTAL/IOException.php
Expand Up @@ -23,4 +23,3 @@
class PHPTAL_IOException extends PHPTAL_Exception
{
}

1 change: 0 additions & 1 deletion classes/PHPTAL/MacroMissingException.php
Expand Up @@ -22,4 +22,3 @@
class PHPTAL_MacroMissingException extends PHPTAL_TemplateException
{
}

1 change: 0 additions & 1 deletion classes/PHPTAL/ParserException.php
Expand Up @@ -22,4 +22,3 @@
class PHPTAL_ParserException extends PHPTAL_TemplateException
{
}

1 change: 0 additions & 1 deletion classes/PHPTAL/Php/Attribute/I18N/Attributes.php
Expand Up @@ -116,4 +116,3 @@ private function _getTranslationCode(PHPTAL_Php_CodeWriter $codewriter, $key)
}
}


1 change: 0 additions & 1 deletion classes/PHPTAL/Php/Attribute/I18N/Domain.php
Expand Up @@ -48,4 +48,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter)
}
}


1 change: 0 additions & 1 deletion classes/PHPTAL/Php/Attribute/I18N/Translate.php
Expand Up @@ -128,4 +128,3 @@ private function _prepareNames(PHPTAL_Php_CodeWriter $codewriter, PHPTAL_Dom_Nod
}
}


1 change: 0 additions & 1 deletion classes/PHPTAL/Php/Attribute/PHPTAL/Debug.php
Expand Up @@ -32,4 +32,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter)
private $_oldMode;
}


1 change: 0 additions & 1 deletion classes/PHPTAL/Php/Attribute/PHPTAL/Tales.php
Expand Up @@ -43,4 +43,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter)
private $_oldMode;
}


1 change: 0 additions & 1 deletion classes/PHPTAL/Php/Attribute/TAL/Comment.php
Expand Up @@ -28,4 +28,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter)
}
}


1 change: 0 additions & 1 deletion classes/PHPTAL/Php/Attribute/TAL/Condition.php
Expand Up @@ -91,4 +91,3 @@ public function talesChainDefaultKeyword(PHPTAL_Php_TalesChainExecutor $executor

}


1 change: 0 additions & 1 deletion classes/PHPTAL/Php/Attribute/TAL/OmitTag.php
Expand Up @@ -68,4 +68,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter)
}
}


1 change: 0 additions & 1 deletion classes/PHPTAL/Php/CodeWriter.php
Expand Up @@ -494,4 +494,3 @@ private function popCodeWriterContext()
private $_xmldeclaration = "";
}


1 change: 0 additions & 1 deletion classes/PHPTAL/Php/Transformer.php
Expand Up @@ -416,4 +416,3 @@ private static function isVarNameChar($c)
);
}


10 changes: 5 additions & 5 deletions classes/PHPTAL/PreFilter/Compress.php
Expand Up @@ -121,7 +121,7 @@ function filterDOM(PHPTAL_Dom_Element $root)
// tal:content may replace element with something without space
if (!$breaks_line && $root->getAttributeNS('http://xml.zope.org/namespaces/tal','content')) {
$this->had_space = false;

$this->most_recent_text_node = null;
}

// line break caused by end tag
Expand Down Expand Up @@ -208,10 +208,10 @@ protected function normalizeAttributes(PHPTAL_Dom_Element $element)
$attrs_by_qname[$attrnode->getQualifiedName()] = $attrnode;
}

if (count($attrs_by_qname) > 1) {
uksort($attrs_by_qname, array($this, 'compareQNames'));
$element->setAttributeNodes(array_values($attrs_by_qname));
}
if (count($attrs_by_qname) > 1) {
uksort($attrs_by_qname, array($this, 'compareQNames'));
$element->setAttributeNodes(array_values($attrs_by_qname));
}
}

/**
Expand Down
12 changes: 6 additions & 6 deletions classes/PHPTAL/TalesRegistry.php
Expand Up @@ -47,7 +47,7 @@ protected function __construct()
$this->registerPrefix('exists', array('PHPTAL_Php_TalesInternal', 'exists'));
$this->registerPrefix('number', array('PHPTAL_Php_TalesInternal', 'number'));
$this->registerPrefix('true', array('PHPTAL_Php_TalesInternal', 'true'));

// these are added as fallbacks
$this->registerPrefix('json', array('PHPTAL_Php_TalesInternal', 'json'), true);
$this->registerPrefix('urlencode', array('PHPTAL_Php_TalesInternal', 'urlencode'), true);
Expand Down Expand Up @@ -109,7 +109,7 @@ public function isRegistered($prefix)
}

private function findUnregisteredCallback($typePrefix)
{
{
// class method
if (strpos($typePrefix, '.')) {
$classCallback = explode('.', $typePrefix, 2);
Expand All @@ -135,7 +135,7 @@ private function findUnregisteredCallback($typePrefix)
if (function_exists($func)) {
return $func;
}

return NULL;
}

Expand All @@ -149,14 +149,14 @@ public function getCallback($prefix)
if ($this->isRegistered($prefix) && !$this->_callbacks[$prefix]['is_fallback']) {
return $this->_callbacks[$prefix]['callback'];
}

if ($callback = $this->findUnregisteredCallback($prefix)) {
return $callback;
}

if ($this->isRegistered($prefix)) {
return $this->_callbacks[$prefix]['callback'];
}
}

return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions doc/Makefile
Expand Up @@ -36,12 +36,12 @@ onepageperchapter: $(XHTMLFILES) output_dir

allononepage: $(XHTMLNOCHUNKSFILES) output_dir
cp -p -- "$(XHTMLNOCHUNKSFILES)" "$(BUILD)/"

plaintext: $(TXTFILES) output_dir
cp -p -- "$(TXTFILES)" "$(BUILD)/phptal.txt"

output_dir:
@test -d "$(BUILD)/split" || mkdir -p -- "$(BUILD)/split"
@test -d "$(BUILD)/split" || mkdir -p -- "$(BUILD)/split"

# create temp output directory for current language
$(TEMP):
Expand Down

0 comments on commit 8059cdf

Please sign in to comment.