Yes, as far as I know the text needs to be visible when you "view source" in order for it to be a factor used in ranking your URL. If the source code references some external URL, that URL might be independently crawled and indexed, but it's not part of the page that referenced it.