Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2024 by Barry MacDonnell. All Rights Reserved.

Page updated Oct 20, 2021

SoftWrap - Prevent long web addresses (URLs) and email addresses from wrapping to the next line as a single block of text

Download SoftWrap.zip (v1.03; 10/20/21; 9,621 bytes)

Originally written in 2002. Revised in WordPerfect 2020 but should be compatible with earlier and later versions

WordPerfect 11 users: See important information about using macros in the first release of WP11 (11.0.0.233) at the top of this page.

Downloading, Documentation, Modifications, and Support


Related pages -

•  How to create hyperlinks (hypertext links) in WordPerfect (see left column there for additional linked pages)

•  Hyphens, hard hyphens,
soft hyphens, hyphenation soft returns, and hard spaces
...
what they are and how they work




Web site and email addresses normally don't have spaces in them, so WordPerfect treats them as a single block of text. Wrapping such long text strings can result in a large empty space left behind in the line above. Also, if margins are narrow it can create a wrapped address that is split in the middle of a component word.

To prevent this from happening, use a hyphenation soft return [Hyph SRt] after each slash mark and double slash mark in an internet address or email address. (See below for other "break" characters.)

It is particularly useful for bibliographies, etc.

Note: In WordPerfect a hyphenation soft return is not a hyphen, it is a soft return placed where a hyphen would be inserted. (Hyphenation soft returns can be inserted with Format, Line, Other codes, or you could assign "Hyphenation Soft Return" to any available keyboard shortcut.) If the line that contains these codes should break apart because of the length of the web site address (the URL) or the email address, it will do so without adding a hyphen.

As The Chicago Manual of Style's FAQ website explains (http://www.press.uchicago.edu/Misc/Chicago/cmosfaq/ -- see under the "URLs" section):

Q. Have you established any rules for breaking Web addresses at ends of lines? I would be inclined to break at the slash where possible, with no hyphen (keeping the address intact), but what about the “dots”? Example: eic.edu.gov.on.ca/html/dsbmaps.html (I’ve got another one that’s a line and a quarter long!).

A. Your instincts are the same as ours -- when a URL must be broken over a line in a printed work, breaking after a slash is preferable (also break after a double slash). On the other hand, breaking a URL after a dot (leaving what looks like a period at the end of a line) might cause difficulties for the reader. It would be better to place the dot at the beginning of the next line. Using a hyphen to break a long word at the end of a line is not a good idea, since some URLs contain hyphens as part of the address; moreover, a hyphen that’s part of a URL should never appear at the end of a line. Further rules are as follows: break before a tilde (~), a hyphen, an underline (_), a question mark, or a percent symbol; or before or after an equals sign or an ampersand.

SoftWrap is a macro that does all this automatically and very quickly. Simply select the entire address and play the macro. It then follows the recommendation ("A." above) to place a hyphenation soft return after all slashes (both single and double) and ampersands (@), and before any period, tilde (~), hard or soft hyphen(-), underscore (_), question mark(?), percent sign(%) or equals sign(=). [Any of these items can be removed from processing in the redlined area of the macro code.]

When the macro finishes the above step it will offer to turn the address into a hyperlink if leads with "http..." or "ftp..." or an email hyperlink if it contains an "@". Just press Yes or No to confirm your choice.[ Tip: During address selections be alert to the presence of any following leading or trailing punctuation marks (e.g., commas, periods, semi-colons, etc.) or other extraneous characters since these would also be included by the macro if you choose to turn the address into a hyperlink.]

[Thanks to "peterm" for comments that led to the idea behind this macro.]