translator hack to avoid failure on opac-opensearch.tmpl
authorGalen Charlton <gmcharlt@gmail.com>
Thu, 7 Oct 2010 01:01:23 +0000 (21:01 -0400)
committerGalen Charlton <gmcharlt@gmail.com>
Thu, 7 Oct 2010 01:01:23 +0000 (21:01 -0400)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
misc/translator/TmplTokenizer.pm

index 1413f77..12076e6 100644 (file)
@@ -527,7 +527,10 @@ sub _next_token_intermediate {
     if (!$this->cdata_mode_p) {
        $it = $this->_next_token_internal($h);
        if (defined $it && $it->type == TmplTokenType::TAG) {
-           if ($it->string =~ /^<(script|style|textarea)\b/is) {
+           if ($it->string =~ /^<(script|style|textarea)\b/is ||
+            ($this->filename =~ /opensearch/ && $it->string =~ /^<(description)\b/) # FIXME special case to handle
+                                                                                    # a CDATA in opac-opensearch.tmpl
+           ) {
                $this->_set_cdata_mode( 1 );
                $this->_set_cdata_close( "</$1\\s*>" );
                $this->_set_pcdata_mode( 0 );