Skip to content

Commit

Permalink
Validator rollup (#27201)
Browse files Browse the repository at this point in the history
* cl/299411284 Allow links with `tel` scheme in email spec

* cl/300054759 github commit msg missing or malformed

* cl/300575599 Revision bump for #27098

* cl/300578001 Revision bump for #27132

* cl/300590811 Revision bump for #27027

* cl/300593269 Revision bump for #27170

* cl/300596115 Revision bump for #27134

* cl/300598356 Revision bump for #27076

* cl/300599497 Revision bump for #26912

Co-authored-by: honeybadgerdontcare <sedano@google.com>
  • Loading branch information
twifkak and honeybadgerdontcare committed Mar 12, 2020
1 parent 7ed0547 commit 527898a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion validator/engine/validator.js
Expand Up @@ -5877,7 +5877,7 @@ class ParsedValidatorRules {

/**
* @param {string} tagName
* @return {TagSpecDispatch|undefined}
* @return {!TagSpecDispatch|undefined}
*/
dispatchForTagName(tagName) {
return this.tagSpecByTagName_[tagName];
Expand Down
3 changes: 2 additions & 1 deletion validator/testdata/amp4email_feature_tests/anchor.html
Expand Up @@ -28,7 +28,7 @@
<!-- URLs must be absolute. -->
<a href="somelink.com">disallowed</a>

<!-- The protocol can only be http, https or mailto. -->
<!-- The protocol can only be http, https, mailto or tel. -->
<a href="ftp://somelink.com">disallowed</a>

<!-- href of anchor is not bindable. -->
Expand Down Expand Up @@ -109,6 +109,7 @@
<a href="http://www.somelink.com">http allowed</a>
<a href="https://www.somelink.com">https allowed</a>
<a href="mailto:user@example.com">mailto allowed</a>
<a href="tel:4156667777">tel allowed</a>

<!-- 'name' attribute is deprecated. -->
<a name="protocol"></a>
Expand Down
5 changes: 3 additions & 2 deletions validator/testdata/amp4email_feature_tests/anchor.out
Expand Up @@ -31,7 +31,7 @@ FAIL
>> ^~~~~~~~~
amp4email_feature_tests/anchor.html:29:2 The relative URL 'somelink.com' for attribute 'href' in tag 'A (AMP4EMAIL)' is disallowed.
|
| <!-- The protocol can only be http, https or mailto. -->
| <!-- The protocol can only be http, https, mailto or tel. -->
| <a href="ftp://somelink.com">disallowed</a>
>> ^~~~~~~~~
amp4email_feature_tests/anchor.html:32:2 Invalid URL protocol 'ftp:' for attribute 'href' in tag 'A (AMP4EMAIL)'.
Expand Down Expand Up @@ -166,10 +166,11 @@ amp4email_feature_tests/anchor.html:106:2 The relative URL '{{#foo}}' for attrib
| <a href="http://www.somelink.com">http allowed</a>
| <a href="https://www.somelink.com">https allowed</a>
| <a href="mailto:user@example.com">mailto allowed</a>
| <a href="tel:4156667777">tel allowed</a>
|
| <!-- 'name' attribute is deprecated. -->
| <a name="protocol"></a>
>> ^~~~~~~~~
amp4email_feature_tests/anchor.html:114:2 The attribute 'name' may not appear in tag 'A (AMP4EMAIL)'.
amp4email_feature_tests/anchor.html:115:2 The attribute 'name' may not appear in tag 'A (AMP4EMAIL)'.
| </body>
| </html>
3 changes: 2 additions & 1 deletion validator/validator-main.protoascii
Expand Up @@ -26,7 +26,7 @@ min_validator_revision_required: 375
# newer versions of the spec file. This is currently a Google internal
# mechanism, validator.js does not use this facility. However, any
# change to this file (validator-main.js) requires updating this revision id.
spec_file_revision: 1012
spec_file_revision: 1020

styles_spec_url: "https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/style_pages"
script_spec_url: "https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml#html-tags"
Expand Down Expand Up @@ -1991,6 +1991,7 @@ tags: {
protocol: "http"
protocol: "https"
protocol: "mailto"
protocol: "tel"
allow_relative: false
}
# Openning doubly curly brackets {{ (these are mustache delimiters) can only
Expand Down

0 comments on commit 527898a

Please sign in to comment.