Mentions of people, places and Avatars in One-box issues

When the body of a comment linked to a Wordpress post has a @mention, #place, or image. The resulting links are relative and that breaks links in the comment. This causes crawlers to choke and other issues. Is there a way to fix this?


<div class="comment-content"><p>Hi <a class="mention" href="/u/jonathan1">@jonathan1</a>,</p>
<p>We announced we will be supporting the Pixel 2 and Pixel 2 XL, earlier today.</p>
<aside class="quote">
  <div class="title">
    <div class="quote-controls"></div>
    <img alt="" width="20" height="20" src="/user_avatar/" class="avatar">
    <a href="" rel="nofollow noopener">Google Pixel 2 and Pixel 2 XL BYOP Support</a> <a class="badge-wrapper  bullet" href="/c/news"><span class="badge-category-bg" style="background-color: #e44e13"></span><span class="badge-category clear-badge" title="Keep up with official Republic Wireless news, releases, and important announcements.">Announcements &amp; News</span></a>
    We’re excited to announce that we’ll be supporting the <a href="" rel="nofollow noopener">Google Pixel 2 and Pixel 2 XL</a> through our <a href="" rel="nofollow noopener">BYOP program</a>!

I think the integration is fixing the @mention but the other two are broken and the source is wrong for all of them causing crawlers to break.

58 PM

<p>Read our announcements <a class="hashtag" href="/c/7-news">#<span>news</span></a></p>

Let me know if more detail is needed.

1 Like

I’m looking at it now. I’ll get back to you soon.


Relative URLs in images and mentions are supposed to be converted to absolute URLs by the plugin, but there are issues with the way it’s doing it. Mention URLs are being converted to absolute URLs with javascript - this isn’t going to work for crawlers, Image URLs are being converted to absolute URLs with a regular expression! There are cases where the regular expression will fail.

Hashtag URLs are not dealt with at all.

I think the whole problem of relative URLs can be approached in a different way. I’ll try to do something with it today. Thanks for bringing this up.


It works, no more regular expressions! The fix depends on the php-xml extension being loaded on the server. Generally it is, but if not, the plugin will fall back to it’s old method. I’ll let you know when it gets pushed to the WordPress repo. It will be sometime tomorrow.


Thank you so much! :grinning: