File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ function main {
27
27
# Build the Docker image, using Docker Hub as a cache. (This will be fast if nothing has changed
28
28
# in html-build or its dependencies).
29
29
docker pull whatwg/wattsi
30
- docker pull ptspts/pdfsizeopt
31
30
docker pull " $docker_hub_repo " || true
32
31
docker build --cache-from " $docker_hub_repo " --tag " $docker_hub_repo " .
33
32
}
Original file line number Diff line number Diff line change @@ -14,6 +14,15 @@ echo "Running conformance checker..."
14
14
java -Xmx1g -jar ./vnu.jar --skip-non-html " $HTML_OUTPUT "
15
15
echo " "
16
16
17
+ # The build output contains some relative links, which will end up pointing to
18
+ # "https://0.0.0.0:$PDF_SERVE_PORT/" in the built PDF. That's undesirable; see
19
+ # https://github.com/whatwg/html/issues/9097. Our hack is to replace such
20
+ # relative links like so. Note: we can't just insert a <base> or use Prince's
21
+ # --baseurl option, because that would cause Prince to crawl the actual live
22
+ # files for subresources, missing any updates to them we made as part of this
23
+ # change.
24
+ sed ' s| href=/| href=https://html.spec.whatwg.org/|g' " $HTML_OUTPUT /index.html" > " $HTML_OUTPUT /print.html"
25
+
17
26
# Serve the built output so that Prince can snapshot it
18
27
# The nohup/sleep incantations are necessary because normal & does not work inside Docker:
19
28
# https://stackoverflow.com/q/50211207/3191
@@ -24,4 +33,6 @@ echo ""
24
33
25
34
echo " "
26
35
echo " Building PDF..."
27
- PATH=/whatwg/prince/bin:$PATH prince --verbose --output " $HTML_OUTPUT /print.pdf" " http://0.0.0.0:$PDF_SERVE_PORT /"
36
+ PATH=/whatwg/prince/bin:$PATH prince --verbose --output " $HTML_OUTPUT /print.pdf" " http://0.0.0.0:$PDF_SERVE_PORT /print.html"
37
+
38
+ rm " $HTML_OUTPUT /print.html"
You can’t perform that action at this time.
0 commit comments