Skip to content

Commit

Permalink
Remove autoescape="strict" attributes from Soy templates.
Browse files Browse the repository at this point in the history
Strict autoescaping is the default so they serve no purpose.

Design doc: []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170360225
  • Loading branch information
vrana authored and emspishak committed Oct 3, 2017
1 parent 7498e91 commit 7ec7361
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/delegates0.soy
Expand Up @@ -15,7 +15,7 @@
// Delegates examples (total 3 files).
// Author: Kai Huang

{namespace soy.examples.delegates autoescape="strict"}
{namespace soy.examples.delegates}


/**
Expand Down
2 changes: 1 addition & 1 deletion examples/delegates1.soy
Expand Up @@ -16,7 +16,7 @@
// Author: Kai Huang

{delpackage alpha}
{namespace soy.examples.delegates.alpha autoescape="strict"}
{namespace soy.examples.delegates.alpha}


/**
Expand Down
2 changes: 1 addition & 1 deletion examples/delegates2.soy
Expand Up @@ -16,7 +16,7 @@
// Author: Kai Huang

{delpackage beta}
{namespace soy.examples.delegates.beta autoescape="strict"}
{namespace soy.examples.delegates.beta}


/**
Expand Down
4 changes: 2 additions & 2 deletions examples/features.soy
Expand Up @@ -15,7 +15,7 @@
// Features examples.
// Author: Kai Huang

{namespace soy.examples.features autoescape="strict"}
{namespace soy.examples.features}


/**
Expand Down Expand Up @@ -104,7 +104,7 @@
/**
* Demo autoescape true.
*/
{template .demoAutoescapeTrue autoescape="strict"}
{template .demoAutoescapeTrue}
{@param italicHtml: ?} /** A string surrounded by HTML italics tags. */
// Note: We explicitly list autoescape="strict" in the 'template' tag for demonstration. Usually
// it's omitted because "strict" is the attribute's default value.
Expand Down
2 changes: 1 addition & 1 deletion examples/simple.soy
Expand Up @@ -15,7 +15,7 @@
// Simple examples.
// Author: Kai Huang

{namespace soy.examples.simple autoescape="strict"}
{namespace soy.examples.simple}


/**
Expand Down
Expand Up @@ -329,7 +329,7 @@ public void testDetachOnCall() throws IOException {
public void testDetachOnParamTransclusion() throws IOException {
CompiledTemplates templates =
TemplateTester.compileFile(
"{namespace ns autoescape=\"strict\"}",
"{namespace ns}",
"",
"/** */",
"{template .caller}",
Expand Down
Expand Up @@ -404,7 +404,7 @@ public String toString() {

private static String toTemplate(String... body) {
StringBuilder builder = new StringBuilder();
builder.append("{namespace ns autoescape=\"strict\"}\n").append("{template .foo}\n");
builder.append("{namespace ns}\n").append("{template .foo}\n");
Joiner.on("\n").appendTo(builder, body);
builder.append("\n{/template}\n");
return builder.toString();
Expand Down
2 changes: 1 addition & 1 deletion java/tests/com/google/template/soy/jbcsrc/api/strict.soy
@@ -1,6 +1,6 @@
// Copyright 2015 Google Inc. All Rights Reserved.

{namespace strict_test autoescape="strict"}
{namespace strict_test}

/** hello html */
{template .helloHtml kind="html"}
Expand Down
Expand Up @@ -38,7 +38,7 @@ public final class CheckTemplateVisibilityTest {
@Test
public void testCallPrivateTemplateFromSameFile() {
SoyFileSetParserBuilder.forFileContents(
"{namespace ns autoescape=\"strict\"}\n"
"{namespace ns}\n"
+ "/** Private template. */\n"
+ "{template .foo visibility=\"private\"}\n"
+ "oops!\n"
Expand All @@ -55,12 +55,12 @@ public void testCallPrivateTemplateFromSameFile() {
public void testCallPrivateTemplateFromSameNamespaceButDifferentFile() {
ErrorReporter errorReporter = ErrorReporter.createForTest();
SoyFileSetParserBuilder.forFileContents(
"{namespace ns autoescape=\"strict\"}\n"
"{namespace ns}\n"
+ "/** Private template. */\n"
+ "{template .foo visibility=\"private\"}\n"
+ "oops!\n"
+ "{/template}",
"{namespace ns autoescape=\"strict\"}\n"
"{namespace ns}\n"
+ "/** Public template. */\n"
+ "{template .bar}\n"
+ "{call .foo /}\n"
Expand All @@ -76,12 +76,12 @@ public void testCallPrivateTemplateFromSameNamespaceButDifferentFile() {
public void testCallPrivateTemplateDifferentFile() {
ErrorReporter errorReporter = ErrorReporter.createForTest();
SoyFileSetParserBuilder.forFileContents(
"{namespace ns autoescape=\"strict\"}\n"
"{namespace ns}\n"
+ "/** Private template. */\n"
+ "{template .foo visibility=\"private\"}\n"
+ "oops!\n"
+ "{/template}",
"{namespace ns2 autoescape=\"strict\"}\n"
"{namespace ns2}\n"
+ "/** Public template. */\n"
+ "{template .bar}\n"
+ "{call ns.foo /}\n"
Expand All @@ -100,15 +100,15 @@ public void testCallPrivateTemplateSameFileNameDifferentDirectory() {
ErrorReporter errorReporter = ErrorReporter.createForTest();
SoyFileSetParserBuilder.forSuppliers(
SoyFileSupplier.Factory.create(
"{namespace ns autoescape=\"strict\"}\n"
"{namespace ns}\n"
+ "/** Private template. */\n"
+ "{template .foo visibility=\"private\"}\n"
+ "oops!\n"
+ "{/template}",
SoyFileKind.SRC,
"foo/bar.soy"),
SoyFileSupplier.Factory.create(
"{namespace ns2 autoescape=\"strict\"}\n"
"{namespace ns2}\n"
+ "/** Public template. */\n"
+ "{template .bar}\n"
+ "{call ns.foo /}\n"
Expand Down
Expand Up @@ -34,7 +34,7 @@ public final class RewriteGlobalsPassTest {
public void testResolveAlias() {
String template =
""
+ "{namespace ns autoescape=\"strict\"}\n"
+ "{namespace ns}\n"
+ "\n"
+ "{alias foo.bar.baz as global}\n"
+ "{alias global.with.sugar}\n"
Expand Down
Expand Up @@ -30,7 +30,7 @@
public final class GenPyCallExprVisitorTest {

private static final String SOY_BASE =
"{namespace boo.foo autoescape=\"strict\"}\n"
"{namespace boo.foo}\n"
+ "{template .goo}\n"
+ " Hello\n"
+ "{/template}\n"
Expand Down
Expand Up @@ -33,7 +33,7 @@
@RunWith(JUnit4.class)
public final class GenPyCodeVisitorTest {

private static final String SOY_NAMESPACE = "{namespace boo.foo autoescape=\"strict\"}\n";
private static final String SOY_NAMESPACE = "{namespace boo.foo}\n";
private static final String DUMMY_SOY_FILE = SOY_NAMESPACE + "{template .dummy}{/template}\n";

private static final String EXPECTED_PYFILE_START =
Expand Down

0 comments on commit 7ec7361

Please sign in to comment.