Forum How do I...?

How to avoid “page 0” added to full URLs?

MPost
My apologies if this has been asked & answered before, I couldn’t find it here in the forum.

I am using target-counter with some “wrapper” text – as seen in the “Tips and Tricks” section of the user guide – to add page numbers to links:

a[href]::after {content: " [see page " target-counter(attr(href), page) "]";}

However, this will also add a “[see page 0)]” to full (https) links, e.g. “go to Google [see page 0]”.

I tried to work around this by adding

#main a[href^http]::after { content: ""; }

to my style sheet (i.e., “Do not add content after links starting with http”), but this results in an error:

warning: parse error in attribute selector at '^'

I would normally work around this by using a CSS class to select / address internal links, but this is not possible in this particular project / workflow, where the HTML converter won’t allow me to add classes to links.

Any ideas how to resolve this?

I am using Prince 14.2.

Thank you.
howcome
Your selector should probably start with:
a[href^=https]

  1. foo.html0.1 kB
MPost
Argh – yes, of course. It now works as intended. Thank you so much!