Title: [Plugin: Linked] Missing space, fixed
Last modified: August 19, 2016

---

# [Plugin: Linked] Missing space, fixed

 *  Resolved [Anthony D Paul](https://wordpress.org/support/users/anthonydpaul/)
 * (@anthonydpaul)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-linked/)
 * I am using the **Linked** plugin by _Skullbit_ that automatically adds hyperlinks
   to URLs.
 * There is a glitch where a space before a URL is being dropped. I found the problem
   on lines 387, 395 and 399 of **linked.php (version 1.0)**.
 * preg_match is looking for a tag bracket (>) or a space (\s) to define the beginning
   of the URL string, then replacing the URL string with the formatted hyperlink,
   without a space (or tag bracket) in front.
 * Simply adding a space before the returned hyperlink would work for some URLs,
   but in other cases, you’d get an extra space where you don’t want it.
 * Instead, if you add $1 at the beginning of the returned string, you will add 
   the space only in the case where a space was detected. Likewise, it will put 
   that HTML end bracket (>) back where it belongs.
 * In the end, these were the edits:
 * **Line 387**
 *     ```
       From = '<a href="mailto:$2">$2</a>'
       To = '$1<a href="mailto:$2">$2</a>'
       ```
   
 * **Line 395**
 *     ```
       From = '<a href="http://$2">$2</a>'
       To = '$1<a href="http://$2">$2</a>'
       ```
   
 * **Line 399**
 *     ```
       From = '<a href="http://$2">$2</a>'
       To = '$1<a href="http://$2">$2</a>'
       ```
   

The topic ‘[Plugin: Linked] Missing space, fixed’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Anthony D Paul](https://wordpress.org/support/users/anthonydpaul/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/plugin-linked/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
