View Single Post
Old 06-03-2022, 04:53 PM   #11
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 318
Karma: 3200000
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
I'm very sure Tex'll have a much better solution than this one, but I figured I'd come back anyway since I said I would. If you try any of this, please save a copy first in case something breaks.

Leaving the body text part alone, since that part seemed ok, I'd try this in that footnotes section. I'd first fix the broken backlink with this regex search:

Find
Code:
(<a class="_idFootnoteAnchor.*?>)(</a>)(.*?)(</p>)
Replace
Code:
\3\1↩\2\4
Basically moving the note contents ahead of the empty <a>, and filling the <a>with a back arrow. Then, to get the numbers back, I'd start with something like:

Find
Code:
<div class="_idFootnotes">
Replace
Code:
<ol class="_idFootnotes">
Find
Code:
</aside>\n</div></body>
Replace
Code:
</aside>\n</ol></body>
That'd change the parent <div> to an <ol>. Note that you'll have to also adjust this in CSS, because InDesign will likely have it in there as div._idFootnotes. If so, you'll have to edit it to ol._idFootnotes, or probably just ._idFootnotes.

After that, I'd do this:

Find
Code:
<aside (id="footnote-\d{1,}")
Replace
Code:
<li \1
Find
Code:
↩</a></p>\n</aside>
Replace
Code:
↩</a></p>\n</li>
You'll have to go back into the CSS again with that to change aside._idFootnote to li._idFootnote, or just ._idFootnote. I attached the basic result, note that I did not bother setting any CSS up here. Again, I wouldn't do it this way unless you can't find a better solution, and I'm sure there is one.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2022-06-03 at 3.47.23 PM.png
Views:	264
Size:	59.8 KB
ID:	194117  
phillipgessert is offline   Reply With Quote