I've got a situation where generated page references need to be screen-reader friendly, and I haven't had much luck sorting it out.
The visual page reference is generated by the following CSS:
... applied to the following HTML:
... which - assuming for the sake of argument that "#appendix-a" is a valid reference that just happens to fall on page 37 - produces PDF output like so:
"See Appendix A (p. 37)."
That's a pretty standard citation, but many screen readers are confused by it - they're thrown by the parentheses, they don't know what the "p" means, and they interpret the period following it as a full stop, so the audible output ends up being something like this:
"See Appendix A pee [long pause] 37 dot"
Not ideal!
My initial thought was to use the prince-alt-text property (in combination with an output profile that supports tagged PDFs, of course) to furnish an alternative, more readable version of the ::after pseudo-element's contents, by doing something like this:
In theory, this would result in alt text reading as follows:
"See Appendix A, page 37."
Screen readers will handle that just fine. However, that doesn't work; as soon as the target-counter enters the mix, the prince-alt-text property stops working. No console message is produced. If I remove the target-counter and leave only the static string, it works, but obviously that doesn't have a useful result. I've tried it using both the current stable build and the latest build (dated 2020-08-12) to similar results.
Any suggestions? Or should this be more of a feature request?
The visual page reference is generated by the following CSS:
a.pageref::after {
content: "\00a0(p.\00a0" target-counter(attr(href), page) ")";
}
... applied to the following HTML:
See <a class="pageref" href="#appendix-a">Appendix A</a>.
... which - assuming for the sake of argument that "#appendix-a" is a valid reference that just happens to fall on page 37 - produces PDF output like so:
"See Appendix A (p. 37)."
That's a pretty standard citation, but many screen readers are confused by it - they're thrown by the parentheses, they don't know what the "p" means, and they interpret the period following it as a full stop, so the audible output ends up being something like this:
"See Appendix A pee [long pause] 37 dot"
Not ideal!
My initial thought was to use the prince-alt-text property (in combination with an output profile that supports tagged PDFs, of course) to furnish an alternative, more readable version of the ::after pseudo-element's contents, by doing something like this:
a.pageref::after {
content: "\00a0(p.\00a0" target-counter(attr(href), page) ")";
prince-alt-text: ", page " target-counter(attr(href), page);
}
In theory, this would result in alt text reading as follows:
"See Appendix A, page 37."
Screen readers will handle that just fine. However, that doesn't work; as soon as the target-counter enters the mix, the prince-alt-text property stops working. No console message is produced. If I remove the target-counter and leave only the static string, it works, but obviously that doesn't have a useful result. I've tried it using both the current stable build and the latest build (dated 2020-08-12) to similar results.
Any suggestions? Or should this be more of a feature request?