Skip to content

Commit 36c305c

Browse files
authored
Merge pull request #4390 from ampproject/update/amphtml-2003031842100
Update allowed tags/attributes from spec in amphtml 2003031842100
2 parents e45877b + 4283c88 commit 36c305c

File tree

4 files changed

+1956
-142
lines changed

4 files changed

+1956
-142
lines changed

bin/amphtml-update.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,10 +787,10 @@ def GetMandatoryOf( attr, constraint ):
787787
Returns:
788788
A list of attributes that have that constraint name.
789789
"""
790-
attributes = []
790+
attributes = set()
791791
for attr_spec in attr:
792792
if attr_spec.HasField(constraint):
793-
attributes.append(
793+
attributes.add(
794794
# Convert something like [src] to data-amp-bind-src.
795795
re.sub(
796796
"^\[(\S+)\]$",
@@ -799,8 +799,7 @@ def GetMandatoryOf( attr, constraint ):
799799
)
800800
)
801801

802-
attributes.sort()
803-
return attributes
802+
return sorted(attributes)
804803

805804
def Phpize(data, indent=0):
806805
"""Helper function to convert JSON-serializable data into PHP literals.

0 commit comments

Comments
 (0)