More accurately determine linkable sources

Use the "\A" metacharacter for the beginning of a string, instead of "^"
for the beginning of any line within that string, and check for "://" as
well.  Fixes #1947.