Hi I have an element with an ID containing percent-encoded scii characters (eg "#%f0%9f%98%85", which is the sweaty-but-happy face emoji), and am wanting to link to it and show the page name (in a table of contents). But Prince isn't able to find the element's page, instead, it says it's on page 0 (see attachments).
Here's the HTML I'm using:
My workaround is to remove the percent-encoded characters. But I'm wondering if there's a better fix?
Here's the HTML I'm using:
<html>
<head>
<style>
.toc li a::after {
content: leader('.') target-counter(attr(href), page) !important;
}
.contents{
page-break-before:always;
}
@page {
@bottom-right {
content: counter(page)
}
}
</style>
</head>
<body>
<h1>My Book</h1>
<h2>Table of Contents</h2>
<ol class="toc">
<li>
<a href="#%f0%9f%98%85">Chapter 1 (no work)</a>
</li>
<li>
<a href="#%%%">Chapter 2 (works)</a>
</li>
<li>
<a href="#f09f9885">Chapter 3 (works)</a>
</li>
</ol>
<div class="contents">
<div id="%f0%9f%98%85">
<h2>Chapter 1</h2>
</div>
<div id="%%%">
<h2>Chapter 2</h2>
</div>
<div id="f09f9885">
<h2>Chapter 3</h2>
</div>
</div>
</body>
</html>
My workaround is to remove the percent-encoded characters. But I'm wondering if there's a better fix?