Skip to main content
Participating Frequently
February 19, 2021
Question

Remove all anchor tags before exporting to HTML

  • February 19, 2021
  • 2 replies
  • 1037 views

My .html file is filled with anchor tags after I export to HTML. <a id="_idTextAnchor006"></a>.

 

I'm trying to figure out how to use GREP to remove these. Here is my code:

 

Find what:

<a id="_idTextAnchor\d\d\d"></a>

Change to:

blank

This topic has been closed for replies.

2 replies

Community Expert
February 20, 2021

A text anchor is ~a

In InDesign Grep search

 

You would look for

(<a id="_id)~a(\d\d\d"></a>)

 

Change to

$1$2

Peter Kahrel
Community Expert
Community Expert
February 20, 2021

If you want to delete all anchors in InDesign, just reolace ~a with nothing. To delete certain anchors in .html files, the code you posted should do the trick. Are you sure that your text editor supports GREP?

hammer0909
Community Expert
Community Expert
February 19, 2021

I'm not sure this is even an InDesign question? Sounds like you're asking how to perform a GREP search using a text editor? If you don't want the anchors, why not delete them from the InDesign document prior to export?

Participating Frequently
February 22, 2021

I am using the built-in InDesign search and replace, not with a text editor. The .HTML file I was referencing is from an .indd export.