@@ -238,7 +238,7 @@ public HtmlPolicyBuilder allowElements(
238238 ElementPolicy policy , String ... elementNames ) {
239239 invalidateCompiledState ();
240240 for (String elementName : elementNames ) {
241- elementName = HtmlLexer .canonicalName (elementName );
241+ elementName = HtmlLexer .canonicalElementName (elementName );
242242 ElementPolicy newPolicy = ElementPolicy .Util .join (
243243 elPolicies .get (elementName ), policy );
244244 // Don't remove if newPolicy is the always reject policy since we want
@@ -286,7 +286,7 @@ public HtmlPolicyBuilder allowCommonBlockElements() {
286286 public HtmlPolicyBuilder allowTextIn (String ... elementNames ) {
287287 invalidateCompiledState ();
288288 for (String elementName : elementNames ) {
289- elementName = HtmlLexer .canonicalName (elementName );
289+ elementName = HtmlLexer .canonicalElementName (elementName );
290290 textContainers .put (elementName , true );
291291 }
292292 return this ;
@@ -305,7 +305,7 @@ public HtmlPolicyBuilder allowTextIn(String... elementNames) {
305305 public HtmlPolicyBuilder disallowTextIn (String ... elementNames ) {
306306 invalidateCompiledState ();
307307 for (String elementName : elementNames ) {
308- elementName = HtmlLexer .canonicalName (elementName );
308+ elementName = HtmlLexer .canonicalElementName (elementName );
309309 textContainers .put (elementName , false );
310310 }
311311 return this ;
@@ -321,7 +321,7 @@ public HtmlPolicyBuilder disallowTextIn(String... elementNames) {
321321 public HtmlPolicyBuilder allowWithoutAttributes (String ... elementNames ) {
322322 invalidateCompiledState ();
323323 for (String elementName : elementNames ) {
324- elementName = HtmlLexer .canonicalName (elementName );
324+ elementName = HtmlLexer .canonicalElementName (elementName );
325325 skipIssueTagMap .put (elementName , HtmlTagSkipType .DO_NOT_SKIP );
326326 }
327327 return this ;
@@ -336,7 +336,7 @@ public HtmlPolicyBuilder allowWithoutAttributes(String... elementNames) {
336336 public HtmlPolicyBuilder disallowWithoutAttributes (String ... elementNames ) {
337337 invalidateCompiledState ();
338338 for (String elementName : elementNames ) {
339- elementName = HtmlLexer .canonicalName (elementName );
339+ elementName = HtmlLexer .canonicalElementName (elementName );
340340 skipIssueTagMap .put (elementName , HtmlTagSkipType .SKIP );
341341 }
342342 return this ;
@@ -349,7 +349,7 @@ public HtmlPolicyBuilder disallowWithoutAttributes(String... elementNames) {
349349 public AttributeBuilder allowAttributes (String ... attributeNames ) {
350350 ImmutableList .Builder <String > b = ImmutableList .builder ();
351351 for (String attributeName : attributeNames ) {
352- b .add (HtmlLexer .canonicalName (attributeName ));
352+ b .add (HtmlLexer .canonicalAttributeName (attributeName ));
353353 }
354354 return new AttributeBuilder (b .build ());
355355 }
@@ -432,7 +432,7 @@ public HtmlPolicyBuilder requireRelsOnLinks(String... linkValues) {
432432 this .extraRelsForLinks = Sets .newLinkedHashSet ();
433433 }
434434 for (String linkValue : linkValues ) {
435- linkValue = HtmlLexer .canonicalName (linkValue );
435+ linkValue = HtmlLexer .canonicalKeywordAttributeValue (linkValue );
436436 Preconditions .checkArgument (
437437 !Strings .containsHtmlSpace (linkValue ),
438438 "spaces in input. use f(\" foo\" , \" bar\" ) not f(\" foo bar\" )" );
@@ -456,7 +456,7 @@ public HtmlPolicyBuilder skipRelsOnLinks(String... linkValues) {
456456 this .skipRelsForLinks = Sets .newLinkedHashSet ();
457457 }
458458 for (String linkValue : linkValues ) {
459- linkValue = HtmlLexer .canonicalName (linkValue );
459+ linkValue = HtmlLexer .canonicalKeywordAttributeValue (linkValue );
460460 Preconditions .checkArgument (
461461 !Strings .containsHtmlSpace (linkValue ),
462462 "spaces in input. use f(\" foo\" , \" bar\" ) not f(\" foo bar\" )" );
@@ -980,7 +980,7 @@ public HtmlPolicyBuilder globally() {
980980 public HtmlPolicyBuilder onElements (String ... elementNames ) {
981981 ImmutableList .Builder <String > b = ImmutableList .builder ();
982982 for (String elementName : elementNames ) {
983- b .add (HtmlLexer .canonicalName (elementName ));
983+ b .add (HtmlLexer .canonicalElementName (elementName ));
984984 }
985985 return HtmlPolicyBuilder .this .allowAttributesOnElements (
986986 policy , attributeNames , b .build ());
0 commit comments