Understanding InDesign’s Hyperlink Formatting
Hyperlinks are probably the most fundamental interactive feature you can build into your InDesign documents. In fact, they’re just about the only interactive feature that works across every kind of interactive document you can export from InDesign, including EPUBs (fixed-layout and reflowable), PDF, DPS (old and new), HTML, and SWF. So with all these hyperlinks to deal with, it’s worth understanding how InDesign handles the formatting of hyperlinks to save yourself some aggravation.
The Hyperlink Character Style and Swatch
Since InDesign CC, a new character style called Hyperlink is created the moment you add the first hyperlink in a document. Strangely, this is true even if you choose not to use the style, and even if the hyperlink is applied to an object and not to text. By default, the Hyperlink character style applies just a blue color and an underline.
A new blue swatch used by the character style (and also called Hyperlink) is created as well.
There is no way to turn off the automatic creation of the character style and swatch, but you are free to edit them or delete them and replace them with another style and swatch.
Setting Default Hyperlink Formatting
In the New Hyperlink dialog box, there is a menu where you can choose to apply the Hyperlink style, another style, or no style to your new hyperlink. You can also create a new character style to use.
The choice you make here is “sticky” meaning that it will apply to all new hyperlinks you create in the document, until you change it in this dialog box (or delete the style and replace it with another or [None]). It will even apply across documents, if you choose any style that exists in both documents, [None], or [Same style].
Changing the formatting of an existing hyperlink won’t affect the formatting that gets applied to new hyperlinks—even if you use the Edit Hyperlink dialog box, which looks identical to the New Hyperlink dialog box.
And if you manually remove the character style applied to an existing hyperlink using the Control panel, the style will still be applied to the next hyperlink you make. Sticky indeed.
One Style Fits All…Except When It Doesn’t
The chosen character style applies itself to all types of new hyperlinks. This is unfortunate because it would be cool if, say, InDesign could remember that you always wanted hyperlinks to text anchors to be formatted with a different style than URLs. Alas, this is not the case.
On the other hand, hyperlinks that you wish would have consistent formatting may not. For example, there’s nothing to prevent shared destinations from having different styles applied to them.
Deleting a Hyperlink Doesn’t Delete Its Formatting
Also, if you decide to remove a hyperlink, the formatting stays, which can lead someone to think there’s a hyperlink where there isn’t.
GREP Style Formatting is Overridden
You might think you could compensate for a lot of these quirks by creating a GREP style to override the formatting from the hyperlink dialog boxes. And you can—but only if you choose [None] or [Same style] in the hyperlink dialog box.
Otherwise, the GREP style formatting will be overridden by the formatting from the chosen hyperlink style. For example, in the screenshot below, a GREP style made both URLs green until the second one was converted to a hyperlink.
Formatting Via Convert URLs to Hyperlinks
One other point worth mentioning is that the Convert URLs to Hyperlinks feature, while somewhat primitive (it thinks any text without spaces around a period is a URL), it does give you the ability to create new hyperlinks at the document or story level, and apply different character styles as you go, like a Find/Change.
So while there’s definitely room for improvement in the way InDesign handles hyperlink formatting, at least now you know where that Hyperlink style and swatch came from, and how to avoid them if you want to.