@@ -238,7 +238,7 @@ public HtmlPolicyBuilder allowElements(
238
238
ElementPolicy policy , String ... elementNames ) {
239
239
invalidateCompiledState ();
240
240
for (String elementName : elementNames ) {
241
- elementName = HtmlLexer .canonicalName (elementName );
241
+ elementName = HtmlLexer .canonicalElementName (elementName );
242
242
ElementPolicy newPolicy = ElementPolicy .Util .join (
243
243
elPolicies .get (elementName ), policy );
244
244
// Don't remove if newPolicy is the always reject policy since we want
@@ -286,7 +286,7 @@ public HtmlPolicyBuilder allowCommonBlockElements() {
286
286
public HtmlPolicyBuilder allowTextIn (String ... elementNames ) {
287
287
invalidateCompiledState ();
288
288
for (String elementName : elementNames ) {
289
- elementName = HtmlLexer .canonicalName (elementName );
289
+ elementName = HtmlLexer .canonicalElementName (elementName );
290
290
textContainers .put (elementName , true );
291
291
}
292
292
return this ;
@@ -305,7 +305,7 @@ public HtmlPolicyBuilder allowTextIn(String... elementNames) {
305
305
public HtmlPolicyBuilder disallowTextIn (String ... elementNames ) {
306
306
invalidateCompiledState ();
307
307
for (String elementName : elementNames ) {
308
- elementName = HtmlLexer .canonicalName (elementName );
308
+ elementName = HtmlLexer .canonicalElementName (elementName );
309
309
textContainers .put (elementName , false );
310
310
}
311
311
return this ;
@@ -321,7 +321,7 @@ public HtmlPolicyBuilder disallowTextIn(String... elementNames) {
321
321
public HtmlPolicyBuilder allowWithoutAttributes (String ... elementNames ) {
322
322
invalidateCompiledState ();
323
323
for (String elementName : elementNames ) {
324
- elementName = HtmlLexer .canonicalName (elementName );
324
+ elementName = HtmlLexer .canonicalElementName (elementName );
325
325
skipIssueTagMap .put (elementName , HtmlTagSkipType .DO_NOT_SKIP );
326
326
}
327
327
return this ;
@@ -336,7 +336,7 @@ public HtmlPolicyBuilder allowWithoutAttributes(String... elementNames) {
336
336
public HtmlPolicyBuilder disallowWithoutAttributes (String ... elementNames ) {
337
337
invalidateCompiledState ();
338
338
for (String elementName : elementNames ) {
339
- elementName = HtmlLexer .canonicalName (elementName );
339
+ elementName = HtmlLexer .canonicalElementName (elementName );
340
340
skipIssueTagMap .put (elementName , HtmlTagSkipType .SKIP );
341
341
}
342
342
return this ;
@@ -349,7 +349,7 @@ public HtmlPolicyBuilder disallowWithoutAttributes(String... elementNames) {
349
349
public AttributeBuilder allowAttributes (String ... attributeNames ) {
350
350
ImmutableList .Builder <String > b = ImmutableList .builder ();
351
351
for (String attributeName : attributeNames ) {
352
- b .add (HtmlLexer .canonicalName (attributeName ));
352
+ b .add (HtmlLexer .canonicalAttributeName (attributeName ));
353
353
}
354
354
return new AttributeBuilder (b .build ());
355
355
}
@@ -432,7 +432,7 @@ public HtmlPolicyBuilder requireRelsOnLinks(String... linkValues) {
432
432
this .extraRelsForLinks = Sets .newLinkedHashSet ();
433
433
}
434
434
for (String linkValue : linkValues ) {
435
- linkValue = HtmlLexer .canonicalName (linkValue );
435
+ linkValue = HtmlLexer .canonicalKeywordAttributeValue (linkValue );
436
436
Preconditions .checkArgument (
437
437
!Strings .containsHtmlSpace (linkValue ),
438
438
"spaces in input. use f(\" foo\" , \" bar\" ) not f(\" foo bar\" )" );
@@ -456,7 +456,7 @@ public HtmlPolicyBuilder skipRelsOnLinks(String... linkValues) {
456
456
this .skipRelsForLinks = Sets .newLinkedHashSet ();
457
457
}
458
458
for (String linkValue : linkValues ) {
459
- linkValue = HtmlLexer .canonicalName (linkValue );
459
+ linkValue = HtmlLexer .canonicalKeywordAttributeValue (linkValue );
460
460
Preconditions .checkArgument (
461
461
!Strings .containsHtmlSpace (linkValue ),
462
462
"spaces in input. use f(\" foo\" , \" bar\" ) not f(\" foo bar\" )" );
@@ -980,7 +980,7 @@ public HtmlPolicyBuilder globally() {
980
980
public HtmlPolicyBuilder onElements (String ... elementNames ) {
981
981
ImmutableList .Builder <String > b = ImmutableList .builder ();
982
982
for (String elementName : elementNames ) {
983
- b .add (HtmlLexer .canonicalName (elementName ));
983
+ b .add (HtmlLexer .canonicalElementName (elementName ));
984
984
}
985
985
return HtmlPolicyBuilder .this .allowAttributesOnElements (
986
986
policy , attributeNames , b .build ());
0 commit comments