Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
10 contributors

Users who have contributed to this file

@honeybadgerdontcare @Gregable @cvializ @choumx @powdercloud @twifkak @danielrozenberg @lannka @jeffkaufman @alin04
182 lines (179 sloc) 5.78 KB
#
# Copyright 2016 The AMP HTML Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the license.
#
# Specific URL to reference for violations having to do with mustache
# templates. These are specific to any particular tag, so must live at
# the top level of this rules file.
template_spec_url: "https://amp.dev/documentation/components/amp-mustache"
tags: { # amp-mustache
html_format: AMP
tag_name: "SCRIPT"
extension_spec: {
name: "amp-mustache"
extension_type: CUSTOM_TEMPLATE
version: "0.1"
version: "0.2"
version: "latest"
deprecated_version: "0.1"
requires_usage: GRANDFATHERED
deprecated_allow_duplicates: true
}
attr_lists: "common-extension-attrs"
}
tags: { # amp-mustache
html_format: AMP4ADS
html_format: AMP4EMAIL
html_format: ACTIONS
tag_name: "SCRIPT"
spec_name: "SCRIPT[custom-element=amp-mustache] (AMP4ADS/AMP4EMAIL)"
extension_spec: {
name: "amp-mustache"
extension_type: CUSTOM_TEMPLATE
version: "0.1"
version: "0.2"
version: "latest"
deprecated_version: "0.1"
}
attr_lists: "common-extension-attrs"
}
# The script element.
tags: {
html_format: AMP
html_format: AMP4ADS
html_format: ACTIONS
tag_name: "SCRIPT"
spec_name: "SCRIPT type=text/plain"
disallowed_ancestor: "TEMPLATE"
disallowed_ancestor: "AMP-DATE-PICKER"
disallowed_ancestor: "FORM DIV [submit-success][template]"
disallowed_ancestor: "FORM DIV [submit-error][template]"
disallowed_ancestor: "FORM DIV [submitting][template]"
disallowed_ancestor: "FORM DIV [verify-error][template]"
requires_extension: "amp-mustache"
attrs: {
disabled_by: "transformed"
name: "nonce"
}
attrs: {
name: "type"
mandatory: true
value_casei: "text/plain"
}
attrs: {
name: "template"
mandatory: true
value: "amp-mustache"
dispatch_key: NAME_VALUE_DISPATCH
}
cdata: {
blacklisted_cdata_regex: {
regex: "<!--"
error_message: "html comments"
}
}
}
tags: {
# The AMP4EMAIL script tag spec is identical to the one above except that it
# should not allow script templates within the form 'submitting' div. There is
# additional latency in rendering A4E templates, which reduces the time
# available to render the template during the submitting state.
html_format: AMP4EMAIL
tag_name: "SCRIPT"
spec_name: "SCRIPT type=text/plain (AMP4EMAIL)"
# <script> tags may not be nested inside other <script> or <template> tags.
disallowed_ancestor: "TEMPLATE (AMP4EMAIL)"
disallowed_ancestor: "AMP-DATE-PICKER"
disallowed_ancestor: "FORM DIV [submit-success][template]"
disallowed_ancestor: "FORM DIV [submit-error][template]"
disallowed_ancestor: "FORM DIV [submitting][template]"
disallowed_ancestor: "FORM DIV [verify-error][template]"
# AMP4EMAIL addition.
disallowed_ancestor: "FORM DIV [submitting]"
requires_extension: "amp-mustache"
attrs: {
disabled_by: "transformed"
name: "nonce"
}
attrs: {
name: "type"
mandatory: true
value_casei: "text/plain"
}
attrs: {
name: "template"
mandatory: true
value: "amp-mustache"
dispatch_key: NAME_VALUE_DISPATCH
}
cdata: {
blacklisted_cdata_regex: {
regex: "<!--"
error_message: "html comments"
}
}
}
# HTML5, 4.11.3 The template element.
tags: {
html_format: AMP
html_format: AMP4ADS
html_format: ACTIONS
tag_name: "TEMPLATE"
mandatory_ancestor: "BODY"
# <template> tags may not be nested inside other <template> tags.
disallowed_ancestor: "TEMPLATE"
# <templates> tags inside <amp-date-picker> have additional requirements
# as specified in the validator-amp-date-picker.protoascii rule file.
disallowed_ancestor: "AMP-DATE-PICKER"
# <templates> tags inside <amp-story-auto-ads> have additional requirements
# as specified in the <amp-story-auto-ads> rule file.
disallowed_ancestor: "AMP-STORY-AUTO-ADS"
disallowed_ancestor: "FORM DIV [submit-success][template]"
disallowed_ancestor: "FORM DIV [submit-error][template]"
disallowed_ancestor: "FORM DIV [submitting][template]"
disallowed_ancestor: "FORM DIV [verify-error][template]"
requires_extension: "amp-mustache"
attrs: {
name: "type"
mandatory: true
value: "amp-mustache"
}
}
tags: {
# The AMP4EMAIL template tag spec is identical to the one above except that it
# should not allow templates within the form 'submitting' div. There is
# additional latency in rendering A4E templates, which reduces the time
# available to render the template during the submitting state.
html_format: AMP4EMAIL
tag_name: "TEMPLATE"
spec_name: "TEMPLATE (AMP4EMAIL)"
mandatory_ancestor: "BODY"
# <template> tags may not be nested inside other <template> tags.
disallowed_ancestor: "TEMPLATE (AMP4EMAIL)"
# <templates> tags inside <amp-date-picker> have additional requirements
# as specified in the validator-amp-date-picker.protoascii rule file.
disallowed_ancestor: "AMP-DATE-PICKER"
disallowed_ancestor: "FORM DIV [submit-success][template]"
disallowed_ancestor: "FORM DIV [submit-error][template]"
disallowed_ancestor: "FORM DIV [submitting][template]"
disallowed_ancestor: "FORM DIV [verify-error][template]"
# AMP4EMAIL addition.
disallowed_ancestor: "FORM DIV [submitting]"
requires_extension: "amp-mustache"
attrs: {
name: "type"
mandatory: true
value: "amp-mustache"
}
}
You can’t perform that action at this time.