Skip to content

Commit 2103e49

Browse files
authored
fix blank boilerplate bug, renovate bot update (#147)
1 parent 3f35f7e commit 2103e49

File tree

5 files changed

+48
-6
lines changed

5 files changed

+48
-6
lines changed

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## AMP HTML Validator 1.0.34
4+
- fix bug that failed to parse with blank amp4email-boilerplate
5+
- upgrade maven-assembly-plugin from 3.4.1 to 3.4.2
6+
- upgrade protobuf-java from 3.21.2 to 3.21.4
7+
- upgrade spotbugs-maven-plugin from 4.7.1.0 to 4.7.1.1
8+
39
## AMP HTML Validator 1.0.33
410
- upgrade exec-maven-plugin from 3.0.0 to 3.1.0
511
- update junit-jupiter-api from 5.8.2 to 5.9.0

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>dev.amp</groupId>
88
<artifactId>validator-java</artifactId>
99
<name>AMP validator Java API</name>
10-
<version>1.0.33</version>
10+
<version>1.0.34</version>
1111
<description>A Java validator for the AMP Html format.</description>
1212
<packaging>jar</packaging>
1313
<url>https://github.com/ampproject/validator-java</url>
@@ -66,7 +66,7 @@
6666
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
6767

6868
<os-maven-plugin.version>1.7.0</os-maven-plugin.version>
69-
<protobuf.version>3.21.2</protobuf.version>
69+
<protobuf.version>3.21.4</protobuf.version>
7070
<maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
7171
<jdk.version>11</jdk.version>
7272
<encoding>UTF-8</encoding>
@@ -262,7 +262,7 @@
262262
<plugin>
263263
<groupId>org.apache.maven.plugins</groupId>
264264
<artifactId>maven-assembly-plugin</artifactId>
265-
<version>3.4.1</version>
265+
<version>3.4.2</version>
266266
</plugin>
267267
<plugin>
268268
<groupId>org.apache.maven.plugins</groupId>
@@ -326,7 +326,7 @@
326326
<plugin>
327327
<groupId>com.github.spotbugs</groupId>
328328
<artifactId>spotbugs-maven-plugin</artifactId>
329-
<version>4.7.1.0</version>
329+
<version>4.7.1.1</version>
330330
<dependencies>
331331
<dependency>
332332
<groupId>com.github.spotbugs</groupId>

src/main/java/dev/amp/validator/AMPHtmlHandler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ public void endElement(final String uri, final String localName, final String qN
196196
try {
197197
if (charactersBuilder != null) {
198198
cdata(charactersBuilder.toString());
199-
} else {
200-
cdata("");
201199
}
202200
} catch (TagValidationException | CssValidationException | IOException e) {
203201
/** ignore */

src/test/java/dev/amp/validator/parser/AMPHtmlParserTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,21 @@ public void testPseudoClassFunctionNot() {
976976
}
977977
}
978978

979+
@Test
980+
public void testCSSBlankBoilerplate() {
981+
try {
982+
String inputHtml =
983+
readFile(
984+
"test-cases/css/testCSSBlankBoilerplate.html");
985+
final int maxNode = 10000;
986+
ValidatorProtos.ValidationResult result =
987+
ampHtmlParser.parse(inputHtml, ValidatorProtos.HtmlFormat.Code.AMP4EMAIL, ExitCondition.FULL_PARSING, maxNode);
988+
Assert.assertEquals(result.getErrorsCount(), 0, "Expecting to have 0 error");
989+
} catch (final IOException ex) {
990+
ex.printStackTrace();
991+
}
992+
}
993+
979994
// TODO: debugging indicates the CSS is tokenized before the length check. Should validate length before.
980995
@Test
981996
public void testStylesheetTooLong() {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
AMP_SELECTORS_PASS
3+
-->
4+
<!doctype html>
5+
<html data-css-strict ⚡4email>
6+
<head>
7+
<meta charset="utf-8">
8+
<script async src="https://cdn.ampproject.org/v0.js"></script>
9+
<script async custom-element="amp-selector" src="https://cdn.ampproject.org/v0/amp-selector-0.1.js"></script>
10+
<style amp4email-boilerplate></style>
11+
</head>
12+
<body>
13+
<amp-selector class="tabs-with-flex" role="tablist" keyboard-select-mode="focus">
14+
<div id="tab1" role="tab" aria-controls="tabpanel1" option selected>Tab one</div>
15+
<div id="tabpanel1" role="tabpanel" aria-labelledby="tab1">Tab one content... </div>
16+
<div id="tab2" role="tab" aria-controls="tabpanel2" option>Tab two</div>
17+
<div id="tabpanel2" role="tabpanel" aria-labelledby="tab2">Tab two content... </div>
18+
<div id="tab3" role="tab" aria-controls="tabpanel3" option>Tab three</div>
19+
<div id="tabpanel3" role="tabpanel" aria-labelledby="tab3">Tab three content... </div>
20+
</amp-selector>
21+
Hello, AMP4EMAIL world.
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)