Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid - Why does autolink ignore the root path of a URL?
    text
    copied!<p>I have a TextView with android:autoLink="web". The text contains some URLs.</p> <p>For example:<br> <a href="http://example.com/" rel="nofollow">http://example.com/</a></p> <p>But when rendered, it links the name scheme and domain name but ignores the root path.</p> <p>Example renders as:<br> <a href="http://example.com" rel="nofollow">http://example.com</a>/</p> <p>Why does it do this and how do I make it autolink fully qualified URLs properly?</p> <p>Edit: Also, URLs followed by a fullstop or comma:<br> <a href="http://example.com/" rel="nofollow">http://example.com/</a>,</p> <p>Are being rendered as:<br> <a href="http://example.com/," rel="nofollow">http://example.com/,</a></p> <p>Note that StackExchange autolinks correctly (look at the source for this question).</p> <p>Edit: Sam, this is the code:</p> <pre><code> &lt;TextView android:id="@+id/open_source" android:text="@string/open_source" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#FFF" android:paddingBottom="10dp" android:autoLink="web" /&gt; </code></pre> <p>Some text:</p> <pre><code>&lt;string name="open_source"&gt;Three examples, fully qualified http://isokeys.sourceforge.net/ missing root path http://isokeys.sourceforge.net and followed with a fullstop http://isokeys.sourceforge.net/.&lt;/string&gt; </code></pre> <p>Should render as:<br> Three examples, fully qualified <a href="http://isokeys.sourceforge.net/" rel="nofollow">http://isokeys.sourceforge.net/</a> missing root path <a href="http://isokeys.sourceforge.net" rel="nofollow">http://isokeys.sourceforge.net</a> and followed with a fullstop <a href="http://isokeys.sourceforge.net/" rel="nofollow">http://isokeys.sourceforge.net/</a>.</p> <p>Is rendered as:<br> Three examples, fully qualified <a href="http://isokeys.sourceforge.net" rel="nofollow">http://isokeys.sourceforge.net</a>/ missing root path <a href="http://isokeys.sourceforge.net" rel="nofollow">http://isokeys.sourceforge.net</a> and followed with a fullstop <a href="http://isokeys.sourceforge.net/." rel="nofollow">http://isokeys.sourceforge.net/.</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload