Turning Off Hyphenation for URLs
Need to break long URLs across a lines, but don't want hyphens? The answer may be simpler than you think!
Beth wrote:
Any clever way you can think of to make InDesign recognize URLs so that it knows to never hyphenate them when breaking lines?
Well, we can’t make InDesign recognize URLs specifically, but we can give you a way to turn off hyphenation for a given string of text. Actually, there are a couple of ways.
First, you could apply the No Break style to the text. But that’s rather extreme, as it won’t let that chunk of text break from one line to another at all. That’s not helpful for long URLs, especially.
The second, more compassionate method, is to change the language of the text to [No Language]. After all, a URL isn’t really English (or Spanish or whatever), and you don’t want to spell-check it anyway. So setting it to No Language means that it won’t cause halts when checking your spelling, and InDesign simply stops trying to hyphenate it. Instead, long URLs break at the punctuation, or in the middle of a word if it’s really long.
If you need to specify a logical place for a long URL to break, you can insert a Discretionary Line Break.
By the way, how do you find all the URLs in your document? Well, one way is with GREP (CS3 and later). Keith Gilbert wrote up a nice method for this on his blog. You could, then, use that GREP to apply the no language designation. Or, in CS4, you could use GREP Styles to apply it automatically in the paragraph style.
This article was last modified on December 19, 2021
This article was first published on October 26, 2008
Commenting is easier and faster when you're logged in!
Recommended for you
How to Quickly Change the Language Used by InDesign
Learn the fastest and easiest way to change the language used in InDesign's inte...
Clear Text Overrides from Word Files
WBB wrote:This is an age-old problem for me... How do I get my Word styles to im...
Importing iWork or Excel or Anything Else Into InDesign
Karen writes: The charts generated by iWork Numbers are beautiful and I would li...
