10-04-2024, 08:58 PM | #1 |
Junior Member
Posts: 7
Karma: 10
Join Date: Aug 2024
Device: All
|
Unnecessary Text Anchors
Hey Everyone,
inDesign automatically added idText Anchors to my chapter headings. I have very short chapters and don't include them in the TOC. I'm inclined to remove these. Are there any good reasons to leave them in? Second question, is there a way to quickly remove them rather than go line by line? Or more specifically, is there a way to use regex \d or similar to search <a id="_idTextAnchor024"></a></h3> so that \d replaces 024? Thanks |
10-04-2024, 09:23 PM | #2 |
Well trained by Cats
Posts: 30,442
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Diaps Toolbag plugin can Delete them no matter how they are used in the block.
|
10-04-2024, 09:29 PM | #3 | |
Evangelist
Posts: 420
Karma: 2737916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
|
Quote:
Code:
<a id="_idTextAnchor\d+"></a> If you want to prevent the problem, maybe head your chapters with a styled <p> instead of some <h> and they likely won't get the anchors (guessing, since I don't use InDesign) |
|
10-04-2024, 09:53 PM | #4 |
Wizard
Posts: 1,354
Karma: 6794938
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
It's not clear but I am guessing the "024" is the chapter number, so you will need to capture it in the Search regex (\d+) so it can be used in the Replace field.
|
10-05-2024, 08:39 AM | #5 |
Grand Sorcerer
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
If you absolutely need the </h3> in the search to get the right matches, consider using a positive lookahead to avoid capturing/replacing it:
Code:
<a id="_idTextAnchor\d+"></a>(?=</h3>) Or you can capture the /h3 and make sure it stays by using it in the replace expression: Code:
<a id="_idTextAnchor\d+"></a></h3> Code:
</h3> Last edited by DiapDealer; 10-05-2024 at 09:34 AM. |
10-05-2024, 10:34 AM | #6 |
Junior Member
Posts: 7
Karma: 10
Join Date: Aug 2024
Device: All
|
Thanks for the help. As everyone noticed, I designated the chapter headers as h3 in indesign. I won't make that mistake again.
|
10-05-2024, 01:02 PM | #7 |
A Hairy Wizard
Posts: 3,220
Karma: 19000635
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Just to be clear, there is nothing wrong with using header tags <h1-6> on headers like chapter titles, etc. That is actually the recommended, and semantically correct, method.
That InDesign adds unnecessary IDs doesn’t mean <h> shouldn’t be used. The IDs themselves don’t hurt anything, and they are easily removed if you really don’t want them in there. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I remove unnecessary space | motsaw | Calibre | 13 | 08-27-2020 05:07 PM |
Totally unnecessary delay! | disconnected | Amazon Kindle | 30 | 11-07-2018 06:57 PM |
iBooks problem with text anchors | iain robinson | ePub | 6 | 03-09-2012 11:32 AM |
Unnecessary conversion | Helsing | Calibre | 9 | 09-04-2010 07:18 PM |