• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

URLs and line breaks: "No Language" has no effect

Contributor ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

I need to automate the way URLs are broken at the end of a line (see CMOS 14.18, "URLs and line breaks"):

 

https://www.aninternetaddress
.com

or

https://www
.aninternetaddress.com

 

Applying a No Language character style to the URL does not prevent it from being broken:

 

https://www.aninternet-
address.com

 

Is this a bug? – Of course I could use a Forced Line Break and accept that the URL won't be clickable in the PDF; in my current project this would be acceptable but I was wondering whether I'm missing something.

 

InDesign 17.4
macOS 12.5.1

TOPICS
Bug

Views

80

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 10, 2022 Sep 10, 2022

Hi @Samuel A_ Try using Discretionary Line Breaks with a No Break applied to aninternetaddress:

 

Screen Shot 17.png

 

 

Type>Insert Break Character>Discretionary Line Break after https://www. and before .com:

 

Screen Shot 18.png

 

 

Screen Shot 19.png

Likes

Translate

Translate
Community Expert ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

Try inserting a discretionary line break character where you want the URL to break. To be certain it is clickable in the PDF you should probably create a hyperlink for the URL in the document.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

Hi @Samuel A_ Try using Discretionary Line Breaks with a No Break applied to aninternetaddress:

 

Screen Shot 17.png

 

 

Type>Insert Break Character>Discretionary Line Break after https://www. and before .com:

 

Screen Shot 18.png

 

 

Screen Shot 19.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 19, 2022 Sep 19, 2022

Copy link to clipboard

Copied

Thank you both, Rob and Peter. Using the Discretionary Line Break does indeed the trick (good idea!) with full stops.

 

However, it doesn't seem to work with single slashes since ID chooses to break after the slash, not before it, even if there is a Discretionary Line Break. So I'll have to use the Forced Line Break in the (rare) cases a line should break there.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 19, 2022 Sep 19, 2022

Copy link to clipboard

Copied

Hi Samuel, note that in my example I’m using a Discretionary Line Break along with No Break. Try setting the text of the URL up to the slash as No Break then add the discretionary line break after the slash.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

Oh, I realise I used [No Language] instead of No Break … Applying the latter to the text up to the slash works, thank you!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Sep 19, 2022 Sep 19, 2022

Copy link to clipboard

Copied

Since you're asking for a way to automate this, check out https://www.id-extras.com/products/hyperlinkpro/

It's not a free add-on, but it specifically uses CMOS rules to break URLs correctly at the end of lines.

One click and your document is done!

It uses the same system suggested above: discretionary line breaks. But it finds the best place to put them within the URL for the smoothest spacing.

If the URL is long, it doesn't always work to break the line after www, or before .com, etc., because it would leave too large a gap between the words on the previous line.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

LATEST

Something like this is probably the only real solution, and it would be nice to see it integrated into ID someday. URLs are both common and, if longer than a few elements, a real PITA to manage in text, notes, etc.

 

Maybe just a "language" that can be applied via a character style, with the break rules etc. embedded in the rules.

 


| Word & InDesign to Kindle & EPUB: a Pro Guide (Amazon)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines