Skip to content

Commit

Permalink
šŸ› Fix value_regex for amp-tiktok@data-src to allow repeating digiā€¦
Browse files Browse the repository at this point in the history
ā€¦ts and a TikTok URL (#35329)

* Fix `value_regex` for `amp-tiktok@data-src` to allow repeating digits

* Expand value_regex to allow a URL containing digits in its last path segment

* Update value_regex to allow digits optionally preceded by a TikTok base URL
  • Loading branch information
westonruter authored Aug 3, 2021
1 parent b31f614 commit 4c7d5d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions extensions/amp-tiktok/0.1/test/validator-amp-tiktok.out
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ FAIL
| <body>
| <!-- Valid -->
| <amp-tiktok width="500" height="500" data-src="6943753342808034566">
>> ^~~~~~~~~
amp-tiktok/0.1/test/validator-amp-tiktok.html:38:2 Tag 'amp-tiktok' must have a minimum of 1 child tags - saw 0 child tags. (see https://amp.dev/documentation/components/amp-tiktok)
| </amp-tiktok>
| <!-- Valid -->
| <amp-tiktok
>> ^~~~~~~~~
amp-tiktok/0.1/test/validator-amp-tiktok.html:41:2 Tag 'amp-tiktok' must have a minimum of 1 child tags - saw 0 child tags. (see https://amp.dev/documentation/components/amp-tiktok)
| width="700"
| height="800"
| data-src="https://www.tiktok.com/@scout2015/video/6943753342808034566">
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-tiktok/validator-amp-tiktok.protoascii
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tags: { # <amp-tiktok>
attr_lists: "extended-amp-global"
attrs: {
name: "data-src";
value_regex: "\\d";
value_regex: "(https://www\\.tiktok\\.com/.*)?\\d+.*";
mandatory: true
}
spec_url: "https://amp.dev/documentation/components/amp-tiktok"
Expand Down

0 comments on commit 4c7d5d7

Please sign in to comment.