Skip to content

Commit

Permalink
Merge pull request #4390 from ampproject/update/amphtml-2003031842100
Browse files Browse the repository at this point in the history
Update allowed tags/attributes from spec in amphtml 2003031842100
  • Loading branch information
westonruter authored Mar 18, 2020
2 parents e45877b + 4283c88 commit 36c305c
Show file tree
Hide file tree
Showing 4 changed files with 1,956 additions and 142 deletions.
7 changes: 3 additions & 4 deletions bin/amphtml-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,10 +787,10 @@ def GetMandatoryOf( attr, constraint ):
Returns:
A list of attributes that have that constraint name.
"""
attributes = []
attributes = set()
for attr_spec in attr:
if attr_spec.HasField(constraint):
attributes.append(
attributes.add(
# Convert something like [src] to data-amp-bind-src.
re.sub(
"^\[(\S+)\]$",
Expand All @@ -799,8 +799,7 @@ def GetMandatoryOf( attr, constraint ):
)
)

attributes.sort()
return attributes
return sorted(attributes)

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

0 comments on commit 36c305c

Please sign in to comment.