View Single Post
Old 08-22-2024, 03:05 PM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,960
Karma: 169810634
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Look at one of your footnotes pointers. Say it looks like <a href="FN_001.xhtml#fn1" epub:type="noteref" id="bookfn1"><sup>[1]</sup></a>. For this one you would look for an entry in the CSS stylesheet called sup. If the class doesn't exist, the default would be vertical-align: super and font-size: smaller. If you saw <sup class="fnstd">, you would look for an entry in the CSS stylesheet called .fnstd. It might contain code such as:

Code:
.fnstd {
  font-size: 0.75em;
  vertical-align: text-top;
}
Please note that in your message that KevinH responded to, you asked "I want to know what the exact form should be of a regular expression to find all links (including endnote markers)." while not supplying any examples of what your footnote to/from code looks like. Sorry to break the bad news but there are many ways of creating those links and you need to supply examples of what the ones that you want to modify look like.

I mean someone could have told you to use "<a href=" but even that simplistic solution breaks when the actual format is "<a class="fnlink" href=". So perhaps "<a " though that will find every link regardless of it's use.

And to be honest, I don't think that KevinH was haughty. His suggestion to move the discussion to the general ePub format and his suggestion (bolding mine) that you:

Quote:
If you ask there and show a few snippets of the xhtml code you use to create a footnote marker, and a few snippets of how the footnotes are coded up, I am sure you will get some help generating a regex for Calibre, or Sigil.
is IMNSHO no more than the minimum needed to have people able to offer help. As you will realize after a while, there is no one true way to write code. You look at 6 ePubs from 6 different creators and that becomes very obvious.
DNSB is offline   Reply With Quote