summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnAlbin2015-03-10 04:53:57 (GMT)
committerJohnAlbin2015-03-10 04:53:57 (GMT)
commitb751d3a2eb21b744bccc2f1443fdc79991e7a8d7 (patch)
treed800d6ae3f8bfab3dbd078e1a871908cee9bb63a
parent4fad3f23b15b309d53aa9c57a5a3678b86e7df02 (diff)
Issue #2269461: process_html_tag() breaks angularjs templates
-rw-r--r--template.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/template.php b/template.php
index 763a24a..e425b9b 100644
--- a/template.php
+++ b/template.php
@@ -221,8 +221,13 @@ function zen_process_html_tag(&$variables) {
$tag = &$variables['element'];
if ($tag['#tag'] == 'style' || $tag['#tag'] == 'script') {
- // Remove redundant type attribute and CDATA comments.
- unset($tag['#attributes']['type'], $tag['#value_prefix'], $tag['#value_suffix']);
+ // Remove redundant CDATA comments.
+ unset($tag['#value_prefix'], $tag['#value_suffix']);
+
+ // Remove redundant type attribute.
+ if (isset($tag['#attributes']['type']) && $tag['#attributes']['type'] !== 'text/ng-template') {
+ unset($tag['#attributes']['type']);
+ }
// Remove media="all" but leave others unaffected.
if (isset($tag['#attributes']['media']) && $tag['#attributes']['media'] === 'all') {